lunes, 11 de julio de 2011

ACTIVIDAD Nº3

Monitor de Servidores Web

  • Lo primero que se realizo fue la instalación de la herramienta de evaluación comparativa que entrega Apache en busca de la medición de performance de los servidores web previamente seleccionados. La instalación se realizo mediante: sudo apt-get install apache2-utils

  • CASO 1:

    se utilizo el servidor : www.google.cl, como primera opciòn de medida, por su gran uso a nivel mundial, el cual entrego:

root@kmilo-Presario-C700-Notebook-PC:/home/kmilo# ab -n 100 -c 10 http://www.google.com/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking www.google.com (be patient).....done

Server Software: gws

Server Hostname: www.google.com

Server Port: 80


Document Path: /

Document Length: 218 bytes


Concurrency Level: 10

Time taken for tests: 7.027 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Non-2xx responses: 100

Total transferred: 60026 bytes

HTML transferred: 21800 bytes

Requests per second: 14.23 [#/sec] (mean)

Time per request: 702.702 [ms] (mean)

Time per request: 70.270 [ms] (mean, across all concurrent requests)

Transfer rate: 8.34 [Kbytes/sec] received


Connection Times (ms)

min mean[+/-sd] median max

Connect: 152 389 771.9 163 3444

Processing: 157 236 203.0 162 1424

Waiting: 157 236 203.0 162 1424

Total: 310 625 872.8 324 4637


Percentage of the requests served within a certain time (ms)

50% 324

66% 366

75% 477

80% 587

90% 774

95% 3804

98% 3813

99% 4637

100% 4637 (longest request)

  • CASO 2: Utilizando el servidor “httpd.apache.org”

root@kmilo-Presario-C700-Notebook-PC:/home/kmilo# ab -n 100 -c 10 httpd.apache.org/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking httpd.apache.org (be patient).....done



Server Software: Apache/2.3.8

Server Hostname: httpd.apache.org

Server Port: 80


Document Path: /

Document Length: 9339 bytes


Concurrency Level: 10

Time taken for tests: 23.691 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 964500 bytes

HTML transferred: 933900 bytes

Requests per second: 4.22 [#/sec] (mean)

Time per request: 2369.102 [ms] (mean)

Time per request: 236.910 [ms] (mean, across all concurrent requests)

Transfer rate: 39.76 [Kbytes/sec] received


Connection Times (ms)

min mean[+/-sd] median max

Connect: 203 1201 2059.2 309 9493

Processing: 414 835 817.3 569 5171

Waiting: 206 356 316.5 257 1720

Total: 617 2036 2511.0 980 14138


Percentage of the requests served within a certain time (ms)

50% 980

66% 1128

75% 2555

80% 3799

90% 5122

95% 6642

98% 11587

99% 14138

100% 14138 (longest request)

  • CASO 3: se uso el servidor de IBM

root@kmilo-Presario-C700-Notebook-PC:/home/kmilo# ab -n 100 -c 10 http://www-01.ibm.com/software/webservers/httpservers/#

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking www-01.ibm.com (be patient).....done



Server Software: IBM_HTTP_Server/7.0.0.9-PM08939

Server Hostname: www-01.ibm.com

Server Port: 80


Document Path: /software/webservers/httpservers/#

Document Length: 16573 bytes


Concurrency Level: 10

Time taken for tests: 27.560 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 1674599 bytes

HTML transferred: 1657300 bytes

Requests per second: 3.63 [#/sec] (mean)

Time per request: 2755.976 [ms] (mean)

Time per request: 275.598 [ms] (mean, across all concurrent requests)

Transfer rate: 59.34 [Kbytes/sec] received


Connection Times (ms)

min mean[+/-sd] median max

Connect: 173 1174 2401.4 242 9233

Processing: 529 1279 2690.7 735 26902

Waiting: 178 381 458.8 243 2591

Total: 705 2453 3535.7 1074 27560

Percentage of the requests served within a certain time (ms)

50% 1074

66% 1594

75% 2076

80% 3899

90% 5605

95% 9787

98% 9856

99% 27560

100% 27560 (longest request)

  • CASO 4: www.aolserver.com

    root@kmilo-Presario-C700-Notebook-PC:/home/kmilo# ab -n 100 -c 10 www.aolserver.com/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking www.aolserver.com (be patient).....done



Server Software: Apache/2.2.3

Server Hostname: www.aolserver.com

Server Port: 80


Document Path: /

Document Length: 15344 bytes


Concurrency Level: 10

Time taken for tests: 8.737 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 1571740 bytes

HTML transferred: 1534400 bytes

Requests per second: 11.45 [#/sec] (mean)

Time per request: 873.668 [ms] (mean)

Time per request: 87.367 [ms] (mean, across all concurrent requests)

Transfer rate: 175.68 [Kbytes/sec] received


Connection Times (ms)

min mean[+/-sd] median max

Connect: 167 218 299.8 187 3185

Processing: 488 598 124.0 530 1156

Waiting: 311 346 65.5 331 795

Total: 675 816 317.7 721 3715


Percentage of the requests served within a certain time (ms)

50% 721

66% 844

75% 866

80% 885

90% 948

95% 994

98% 1357

99% 3715

100% 3715 (longest request)


La segunda parte de esta actividad consiste en subir archivos a streaming de audio y video. Con ellos medir su comportamiento durante el proceso capturándolos con AB.

Para el caso de audio, se uso el archivo “novedades.mp3” con un peso de 2,4 Mb y una duración de 1 minuto 46 segundos; se usaron paginas de audio como:

  1. www.goear.com”

  2. www.box.net

    En el caso de video, se uso el archivo “video.mp4”, con un peso de 4,1 Mb, una duración de 12 segundos en los servidores:

  1. www.box.net

  2. www.youtube.com

Cada uno de ellos con la propiedad de crear cuentas y subir archivos de su respectiva parte.

AUDIO, CASO 1:

root@kmilo:/home/kmilo# ab -n 100 -c 10 http://www.goear.com/listen/e8b4964/prueba-asd

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.goear.com (be patient).....done

Server Software: Goear

Server Hostname: www.goear.com

Server Port: 80

Document Path: /listen/e8b4964/prueba-asd

Document Length: 18360 bytes

Concurrency Level: 10

Time taken for tests: 17.950 seconds

Complete requests: 100

Failed requests: 96

(Connect: 0, Receive: 0, Length: 96, Exceptions: 0)

Write errors: 0

Total transferred: 1869597 bytes

HTML transferred: 1836097 bytes

Requests per second: 5.57 [#/sec] (mean)

Time per request: 1795.034 [ms] (mean)

Time per request: 179.503 [ms] (mean, across all concurrent requests)

Transfer rate: 101.71 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 243 337 296.7 324 3253

Processing: 734 1320 1083.9 994 9359

Waiting: 250 408 260.1 331 1611

Total: 979 1657 1108.5 1322 9602

Percentage of the requests served within a certain time (ms)

50% 1322

66% 1367

75% 1437

80% 1885

90% 2758

95% 3990

98% 4435

99% 9602

100% 9602 (longest request)

  • AUDIO, CASO 2:

root@kmilo:/home/kmilo# ab -n 100 -c 10 http://www.box.net/embed/4418tlmt1gml9ce.swf

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.box.net (be patient).....done

Server Software: nginx/0.6.39

Server Hostname: www.box.net

Server Port: 80

Document Path: /embed/4418tlmt1gml9ce.swf

Document Length: 208835 bytes

Concurrency Level: 10

Time taken for tests: 34.120 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 20939800 bytes

HTML transferred: 20883500 bytes

Requests per second: 2.93 [#/sec] (mean)

Time per request: 3412.025 [ms] (mean)

Time per request: 341.202 [ms] (mean, across all concurrent requests)

Transfer rate: 599.32 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 196 1302 1445.2 234 3311

Processing: 1428 1946 498.8 1744 4039

Waiting: 233 348 323.6 249 2704

Total: 1646 3249 1530.5 2657 7271

Percentage of the requests served within a certain time (ms)

50% 2657

66% 4787

75% 4955

80% 4987

90% 5260

95% 5574

98% 6044

99% 7271

100% 7271 (longest request)

  • VIDEO, CASO 1:

root@kmilo:/home/kmilo# ab -n 100 -c 10 http://www.box.net/embed/4418tlmt1gml9ce.swf

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.box.net (be patient).....done

Server Software: nginx/0.6.39

Server Hostname: www.box.net

Server Port: 80

Document Path: /embed/4418tlmt1gml9ce.swf

Document Length: 208835 bytes

Concurrency Level: 10

Time taken for tests: 34.120 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 20939800 bytes

HTML transferred: 20883500 bytes

Requests per second: 2.93 [#/sec] (mean)

Time per request: 3412.025 [ms] (mean)

Time per request: 341.202 [ms] (mean, across all concurrent requests)

Transfer rate: 599.32 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 196 1302 1445.2 234 3311

Processing: 1428 1946 498.8 1744 4039

Waiting: 233 348 323.6 249 2704

Total: 1646 3249 1530.5 2657 7271

Percentage of the requests served within a certain time (ms)

50% 2657

66% 4787

75% 4955

80% 4987

90% 5260

95% 5574

98% 6044

99% 7271

100% 7271 (longest request)

  • VIDEO, CASO 2:

root@kmilo:/home/kmilo# ab -n 100 -c 10 http://www.youtube.com/watch?v=Pkr-hXsuSek

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.youtube.com (be patient).....done

Server Software: wiseguy/0.6.10

Server Hostname: www.youtube.com

Server Port: 80

Document Path: /watch?v=Pkr-hXsuSek

Document Length: 54952 bytes

Concurrency Level: 10

Time taken for tests: 15.669 seconds

Complete requests: 100

Failed requests: 88

(Connect: 0, Receive: 0, Length: 88, Exceptions: 0)

Write errors: 0

Total transferred: 5630884 bytes

HTML transferred: 5561848 bytes

Requests per second: 6.38 [#/sec] (mean)

Time per request: 1566.890 [ms] (mean)

Time per request: 156.689 [ms] (mean, across all concurrent requests)

Transfer rate: 350.94 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 156 446 861.8 173 3209

Processing: 597 1018 761.4 808 5509

Waiting: 240 495 765.9 265 4985

Total: 784 1464 1130.7 997 5714

Percentage of the requests served within a certain time (ms)

50% 997

66% 1025

75% 1072

80% 1168

90% 3841

95% 4017

98% 5662

99% 5714

100% 5714 (longest request)

CONCLUSIONES


Al utilizar el comando AB para comparar los servidores web, se pudo apreciar, en la primera actividad, la siguiente tabla de valores:




De lo cual se obtiene que el servidor aolserver posee una mejor performance que los otros evaluados.

En el caso de la actividad 2, los de “audio” arrojaron:

De lo cual se obtiene que “box.net” entrega un mejor servicio que su par evaluado “goear.com”


Mientras que “video” entrego:

Una notoria diferencia beneficiando a youtube.


DESCARGA DOCUMENTO

viernes, 8 de julio de 2011

PROCEDIMIENTO Y ANÁLISIS EN MÁQUINA DE 1 NÚCLEO



Para los mismos códigos empleados en la parte anterior, se ejecutaron en un pc de 1 nucleo Pentium 4 1.7 GHz


  • Lo primero que se realizó fue ejecutar el algoritmo Sieve de criba mediante el comando time: time python sievedecriba.py



el cual arrojo:

  • real : 0.020s

  • user: 0.012s

  • sys: 0.004s




Luego se ejecutó el algoritmo de fibonacci, en lenguaje python mediante: time python fibonacci.py


Con 10000000 entradas, arrojo:

  • real: 21,731 s.

  • user: 0,016 s.

  • sys: 0,000 s.


Luego se ejecutó el algoritmo de Ackermann, en lenguaje python mediante: python ackermann.py

Una vez ejecutado se hizo con el comando time: time python ackermann.py



El cual entrego:

  • real: 0,020 s.

  • user: 0,018 s.

  • sys: 0.00 s.



Luego se ejecutó el algoritmo de ordenamiento Bubblesort, en lenguaje python mediante: time python bubblesort.py



El cual entrego:

  • real: 0,019 s.

  • user: 0,008 s.

  • sys: 0,008 s.


CONCLUSIONES


Al utilizar el comando time para comparar algoritmos de benchmark, se pudo apreciar que en la máquina de 4 núcleos, en relación a la de 1 núcleo:


4 nucleos 1 nucleo
sieve de criba 0.032s 0.020 s
fibonacci 3.315s 21,731 s.
Ackermann 0.024s 0,020 s.
burbuja 0.025s 0,019 s.

Considerando los tiempos entregados por el parámetro “real” entrega números no pensados, ya que se suponía que la maquina de 4 núcleos fuera mucho menor el tiempo de ejecución. Esto se debe a que los algoritmos no presentan compatibilidad de multiprocesadores.


De todas manera, no se aprecian grandes diferencias, a pesar del “fibonacci”, donde el tiempo en 4 núcleos es 3,31 s. y en 1 núcleo 21,731 segundos. Diferencia significativa.


Gracias a la situación planteada de “fibonacci” se considera, lógicamente, que el ordenador de 4 nucles presenta un mejor desplante sobre estos algoritmos.


DESCARGA INFORME


jueves, 7 de julio de 2011

Comparación de algoritmos Benchmark en máquinas de 4 núcleos y de 1 núcleo mediante el comando time

La presente actividad tiene por finalidad, comparar algoritmos de benchmark en dos computadores distintos, uno de cuatro núcleos y de un núcleo para realizar la comparación del tiempo de ejecución en ambas máquinas mediante el comando time, en los siguientes algoritmos:

ü  Sieve de criba
ü  Ackermann
ü  Fibonacci
ü  Bubblesort

PROCEDIMIENTO Y ANÁLISIS EN MÁQUINA DE 4 NÚCLEOS



ü  Lo primero que se realizó fue ejecutar el algoritmo Sieve de criba, en lenguaje python mediante: python sievedecriba.py
Una vez ejecutado se hizo con el comando time: time python sievedecriba.py


fig. 1




ü  Que arrojó lo siguiente:
ü  real 0m0.032s
ü  user 0m0.010s
ü  sys  0m0.020s
ü  Código fuente del algoritmo sieve de criba utilizado:
ü  #!/usr/bin/python
ü  # -*- coding: <encoding name> -*-
def sieveOfEratosthenes(n, stop=0):
        l = [2] # Creamos una lista que ya contenga el numero 2, que es el unico numero par primo.
        d = [] # Lista de numeros no primos
        top = int(math.floor(math.sqrt(n)))+1 # Definimos hasta que numero multiplicaremos
        for i in range(3,n,2): # Iniciamos un bucle desde el 3 hasta 'n', dando un salto de 2 numeros para
                               # recorrer solamente los numeros impares.
                if i>top: # Si ya hemos multiplicado todo lo necesario...
                        if i not in d: # ...comprobamos que el numero actual no este en la lista de excluidos...
                                                if stop==i: return 1 # ...si debemos detenernos nos detenemos y devolvemos 1
                                l.append(i) # ...y lo marcamos como primo...
                        else:
                                d = d[d.index(i)+1:] # Para aligerar memoria, redefinimos la lista de excluidos
                                                     # desde el indice siguiente al numero actual en adelante.
                elif i not in d: # Si el numero actual no esta en la lista de excluidos...
                        if stop==i: return 1 # ...si debemos detenernos nos detenemos y devolvemos 1
                        l.append(i) # ...lo marcamos como primo...
                        for j in range(i,n,i): # y excluimos todos sus multiplos menores o iguales a 'n'
                                d.append(j)
                else:
                        d = d[d.index(i)+1:] # Para aligerar memoria, redefinimos la lista de excluidos
                                             # desde el indice siguiente al numero actual en adelante.
        return l # Devuelve la lista de numeros primos <=n


def lcm(x, y):
        if x==y: return x # si los dos numeros son iguales devolvemos el numero,
                          # puesto que mcm(5,5) es 5

        # Definimos 'a' como el numero mayor y 'b' como el numero menor, solamente
        # por comodidad.
        a = x if x>y else y
        b = x if x<y else y

        # Redefinimos 'x' como el numero mayor para utilizarlo en el bucle final.
        x = a

        # Si 'a' es multiplo de 'b' devolvemos 'a', puesto que mcm(10,5) es 10.
        if a%b==0: return a

        # Definimos 'm' como el maximo numero hasta el cual se comprobara si alguno
        # de los argumentos es un numero primo.
        m = 1000

        # Comprobamos que alguno de los dos argumentos sea menor que 'm', y llamamos
        # a la funcion anterior diciendole que nos detengamos en dicho numero.
        #
        # La razon de esto es que la funcion de la criba de Eratostenes nos devuelve
        # siempre una lista, pero si le decimos que se detenga en un numero, y ese
        # numero es primo, nos devuelve un entero.
        #
        # Y como el minimo comun multiplo de un numero compuesto y un primo, o dos
        # primos es la multiplicacion de dichos numeros, devolvemos el resultado de
        # dicha multiplicacion.
        if b<=m:
                if type(sieveOfEratosthenes(b+1,b))==type(1): return a*b
        elif a<=m:
                if type(sieveOfEratosthenes(a+1,a))==type(1): return a*b

        # Si no se ha hallado aun el minimo comun multiplo, iniciamos un bucle donde
        # al numero mayor se le sumara su mismo numero hasta que sea multiplo del
        # numero menor, que sera entonces cuando finalicemos la funcion devolviendo
        # el minimo comun multiplo de 'x' e 'y'.
        while a%b!=0:
                a+=x
        return a


ü  Luego se ejecutó el algoritmo de fibonacci, en lenguaje python mediante: python fibonacci.py
Una vez ejecutado se hizo con el comando time: time python fibonacci.py


fig. 2


ü  Que arrojó lo siguiente:
ü  real 0m3.315s
ü  user 0m0.010s
ü  sys  0m0.010s


ü  Código fuente del algoritmo fibonacci utilizado:
ü  #! /usr/bin/env python
ü  # -*- coding: utf-8 -*-

n = int(raw_input("¿Valor tope da serie? "))
print " Serie de Fibonacci "

a, b = 0, 1

while b <= n:
    print b
    a, b = b, a + b



ü  Luego se ejecutó el algoritmo de Ackermann, en lenguaje python mediante: python ackermann.py
ü  Una vez ejecutado se hizo con el comando time: time python ackermann.py
fig. 3


ü  Que arrojó lo siguiente:
ü  real 0m0.024s
ü  user 0m0.010s
ü  sys  0m0.010s
ü  Código fuente del algoritmo ackermann de criba utilizado:

#!/usr/local/bin/python

def a(n,m):
    if n==0:
        return m+1
    if m==0:
        return a(n-1,1)
    return a(n-1,a(n,m-1))

ü  Luego se ejecutó el algoritmo de ordenamiento Bubblesort, en lenguaje python mediante: bubblesort ackermann.py
ü  Una vez ejecutado se hizo con el comando time: time python bubblesort.py



fig. 4



ü  Que arrojó lo siguiente:
ü  real 0m0.025s
ü  user 0m0.010s
ü  sys  0m0.010s
ü  Código fuente del algoritmo de ordenamiento bubblesort utilizado:

#!/usr/local/bin/python
# Bubble Sort
# KYA
# 7-20-08
def bubbleSort(theList, max):
    for n in range(0,max): #upper limit varies based on size of the list
        temp = 0
        for i in range(1, max): #keep this for bounds purposes
            temp = theList[i]
            if theList[i] < theList[i-1]:
                theList[i] = theList[i-1]
                theList[i-1] = temp