Tag Archives: iis

Server Web

lighttpd vs IIS

Linux è un sistema molto popolare per i server, in particolare per i web server.
Negli ultimi 10 anni ha polverizzato le quote di mercato dei sistemi Unix (HP-UX, AIX, Solaris, Tru64, *BSD) ed ha significativamente intaccato quelle della Microsoft.

Alcuni utenti/sistemisti Windows considerano Linux un sistema operativo per adolescenti che giocano a fare gli hacker, assolutamente inferiore anche a livello server.

Dato che  “get the fact!” non è una prova, ma contano i benchmark, ho fatto un esperimento per vedere come stiano realmente le cose.

Ho preso in considerazione 2 server collegati alla rete col medesimo switch a 100 Mbit: un computer con Linux ed un server Windows.

Caratteristiche

  • Server Linux: P4 2,4 GHz, 1GB RAM, HDD SATA 80GB 7.2K rpm 8MB cache
  • Server Windows: IBM eServer Xseries, Intel Xeon 3,06 GHz, 4GB RAM, HDD 3x73GB Ultra 320 SCSI 3.5” 10k rpm

Tool per il benchmark: ab

Primo test

  • # ab -n 100 -c 5 http://xxx/xxx.html
    100 connessioni in totale, 5 alla volta
Server Software: Linux 2.6.32/lighttpd 1.4.25Server Hostname: xxxServer Port: 80Document Path: /xxx/xxx.htmlDocument Length: 6397 bytes

Concurrency Level: 5

Time taken for tests: 0.098 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 670744 bytes

HTML transferred: 643777 bytes

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

Time per request: 4.907 [ms] (mean)

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

Transfer rate: 6673.70 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.4 0 3

Processing: 2 2 0.4 2 4

Waiting: 1 1 0.4 1 3

Total: 2 3 0.6 3 6

Server Software: Windows Server 2003/IIS 6.0Server Hostname: xxxServer Port: 80Document Path: /xxx/xxx.htmlDocument Length: 4724 bytes

Concurrency Level: 5

Time taken for tests: 0.361 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 499736 bytes

HTML transferred: 474890 bytes

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

Time per request: 18.062 [ms] (mean)

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

Transfer rate: 1350.95 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 1 4 2.8 3 17

Processing: 5 12 6.4 10 33

Waiting: 3 7 4.8 6 25

Total: 6 16 8.0 14 39

Il file html usato sul server Linux con lighttpd è di qualche KB più grande rispetto a quello usato per il test su Windows 2003 server con IIS6, nonostante ciò il server Linux ha impiegato meno di 1/3 del tempo di Windows per servire le pagine.
Ogni richiesta è stata completata in meno di 1 millisecondo, contro i 3,6 che in media sono serviti a Windows.

100 connessioni sono però poca cosa, anche Windows con IIS è riuscito a completarle in un tempo decente (0,36 secondi).

Secondo test

  • # ab -n 10000 -c 100 http://xxx/xxx.html
    10.000 connessioni in totale, 100 alla volta
Server Software: Linux 2.6.32/lighttpd 1.4.25Server Hostname: xxxServer Port: 80Document Path: /xxx/xxx.htmlDocument Length: 6397 bytes

Concurrency Level: 100

Time taken for tests: 6.049 seconds

Complete requests: 10000

Failed requests: 0

Write errors: 0

Total transferred: 66761632 bytes

HTML transferred: 64084156 bytes

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

Time per request: 60.492 [ms] (mean)

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

Transfer rate: 10777.74 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 5 19 2.9 19 28

Processing: 7 41 3.9 41 71

Waiting: 6 21 3.4 21 53

Total: 13 60 2.8 60 78

Server Software: Windows Server 2003/IIS 6.0Server Hostname: xxxServer Port: 80Document Path: /xxx/xxx.htmlDocument Length: 5302 bytes

Concurrency Level: 100

Time taken for tests: 20.659 seconds

Complete requests: 10000

Failed requests: 0

Write errors: 0

Total transferred: 55480000 bytes

HTML transferred: 53020000 bytes

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

Time per request: 206.594 [ms] (mean)

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

Transfer rate: 2622.52 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 1 50 342.5 12 9007

Processing: 4 121 645.3 29 12169

Waiting: 3 102 633.6 16 12167

Total: 6 171 730.6 42 12186

Anche in questo caso il server Linux ha impiegato meno di 1/3 del tempo di Windows; ogni richiesta è stata completata in circa 0,6 millisecondi, contro i 2 di Windows.

Un normalissimo PC con un PIV 2,4 GHZ ed 1 GB di RAM, grazie a Linux, si è dimostrato 3 volte più performante di un ben più potente (e costoso) server IBM con processore Xeon 3,06 MHz, 4 Gb RAM, equipaggiato con Windows 2003 server e IIS6.