Teste de Escalabilidade Simples: Apache 2.2.3 x IIS 7

Este é um teste simples de escalabilidade entre o Apache 2.2.3 e o IIs 7.

Este teste foi motivado por uma observação de um grande cliente que atendemos, que mencionou que tem problemas de escalabilidade com o Apache. eu tenho certeza que o Apache pode responder as requisições que o cliente precisa, mas por este percebi que com a configuração padrão, isto não é possível, são necessários ajustes.

O Apache é o padrão do CentOS 5.5, o mais atual. Todas as configurações padrão foram mantidas.

O IIS é o padrão do Windows Server 2008 Enterprise. Todas as configurações padrão foram mantidas.

O teste foi feito 3 vezes, com 10000 requisições, com concorrência de 1000, para o arquivo inicial de cada Web Server: iisstart.htm para o IIS, e index.html para o Apache.

Tanto o CentOS quanto o Windows estão em VMs, com a mesma configuração: 2GB RAM, 1 CPU. Apenas uma VM foi ligada de cada vez.

As VMs foram criadas com o VirtualBox, rodando em Ubuntu 10.4, em um Notebook Dual Core com 4GB de RAM e HD de 500GB 7200RPM.

IIS 7:

ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.101/issstart.html

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 192.168.56.101 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:        Microsoft-IIS/7.0
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /issstart.html
Document Length:        1245 bytes

Concurrency Level:      1000
Time taken for tests:   9.050 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Non-2xx responses:      10000
Total transferred:      14010000 bytes
HTML transferred:       12450000 bytes
Requests per second:    1104.94 [#/sec] (mean)
Time per request:       905.029 [ms] (mean)
Time per request:       0.905 [ms] (mean, across all concurrent requests)
Transfer rate:          1511.73 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    4   9.4      1      44
Processing:    69  867 138.4    862    1436
Waiting:       69  867 138.4    862    1436
Total:        112  871 136.2    862    1472

Percentage of the requests served within a certain time (ms)
50%    862
66%    870
75%    876
80%    883
90%   1029
95%   1069
98%   1203
99%   1246
100%   1472 (longest request)
ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.101/issstart.html
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 192.168.56.101 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:        Microsoft-IIS/7.0
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /issstart.html
Document Length:        1245 bytes

Concurrency Level:      1000
Time taken for tests:   9.299 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Non-2xx responses:      10000
Total transferred:      14010000 bytes
HTML transferred:       12450000 bytes
Requests per second:    1075.38 [#/sec] (mean)
Time per request:       929.903 [ms] (mean)
Time per request:       0.930 [ms] (mean, across all concurrent requests)
Transfer rate:          1471.30 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    4   9.6      1      54
Processing:    61  889 177.8    905    1310
Waiting:       60  889 177.8    905    1310
Total:        114  893 170.6    907    1311

Percentage of the requests served within a certain time (ms)
50%    907
66%    930
75%    958
80%    973
90%   1100
95%   1110
98%   1142
99%   1273
100%   1311 (longest request)
ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.101/issstart.html
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 192.168.56.101 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:        Microsoft-IIS/7.0
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /issstart.html
Document Length:        1245 bytes

Concurrency Level:      1000
Time taken for tests:   8.807 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Non-2xx responses:      10000
Total transferred:      14010000 bytes
HTML transferred:       12450000 bytes
Requests per second:    1135.50 [#/sec] (mean)
Time per request:       880.666 [ms] (mean)
Time per request:       0.881 [ms] (mean, across all concurrent requests)
Transfer rate:          1553.56 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    4  10.3      1      54
Processing:    47  843 161.3    880    1124
Waiting:       47  843 161.3    880    1124
Total:        100  847 152.4    881    1124

Percentage of the requests served within a certain time (ms)
50%    881
66%    901
75%    906
80%    912
90%    940
95%   1039
98%   1081
99%   1092
100%   1124 (longest request)
ricardo@ricardo-laptop:~$

Apache 2.2.3:

ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.102/index.html
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 192.168.56.102 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
apr_socket_recv: Connection reset by peer (104)
Total of 9445 requests completed
ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.102/index.html
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 192.168.56.102 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
apr_socket_recv: Connection reset by peer (104)
Total of 6342 requests completed
ricardo@ricardo-laptop:~$ ab -n 10000 -c 1000 http://192.168.56.102/index.html
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 192.168.56.102 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
apr_socket_recv: Connection reset by peer (104)
Total of 6133 requests completed
ricardo@ricardo-laptop:~$

Conclusão

O IIS 7 escala melhor, as requisições são respondidas mais rapidamente, tanto individualmente quanto no total.

O Apache , além de respostas mais lentas, não atendeu todas. sendo que no último teste atender apenas 61% das requisições.

Em um próximo Post irei executar o Tuning do Apache para que este problema seja solucionado.

One comment

  1. Faça o mesmo teste com o Nginx e veja se ele é melhor 🙂
    As configurações default do apache é um problema, eles querem deixar funcionando para qualquer configuração de maquina e acontece isso.

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.