Comparação de Configuração de Servidor Rails
Esse é o início de um teste para chegarmos um dia em uma configuração legal de uma aplicação feita em Ruby On Rails.
Atualmente estamos rodando a aplicação
Criamos utilizando FAST CGI , isso significa dizer que para cada requisição feita pelo navegador ele carrega lalalala descrver melhor isso.
Os testes foram realizados num mesmo computador com a configuração descrita
aqui e com um link de 1MB da velox.
Rodando com a configuração descrita acima ficamos com o seguinte resultado acessando a página inicial do sistema utilizando a ferramenta ab (do pacote apache-utils). Realizando
X requisições.
Configuração 1
A primeira configuração utilizada para os teste foi:
Obtemos o seguinte resultado:
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking demos.colivre.coop.br (be patient).....done
Server Software: Apache/2.2.3
Server Hostname: demos.colivre.coop.br
Server Port: 80
Document Path: /criamos/
Document Length: 114 bytes
Concurrency Level: 1
Time taken for tests: 2.480964 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Non-2xx responses: 1
Total transferred: 500 bytes
HTML transferred: 114 bytes
Requests per second: 0.40 [#/sec] (mean)
Time per request: 2480.964 [ms] (mean)
Time per request: 2480.964 [ms] (mean, across all concurrent requests)
Transfer rate: 0.00 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 287 287 0.0 287 287
Processing: 2193 2193 0.0 2193 2193
Waiting: 2159 2159 0.0 2159 2159
Total: 2480 2480 0.0 2480 2480
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking demos.colivre.coop.br (be patient).....done
Server Software: Apache/2.2.3
Server Hostname: demos.colivre.coop.br
Server Port: 80
Document Path: /criamos/
Document Length: 114 bytes
Concurrency Level: 1
Time taken for tests: 14.163538 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Non-2xx responses: 5
Total transferred: 2500 bytes
HTML transferred: 570 bytes
Requests per second: 0.35 [#/sec] (mean)
Time per request: 2832.708 [ms] (mean)
Time per request: 2832.708 [ms] (mean, across all concurrent requests)
Transfer rate: 0.14 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 272 281 7.6 285 288
Processing: 2168 2551 511.8 2623 3159
Waiting: 2140 2517 510.2 2588 3123
Total: 2451 2832 512.1 2904 3447
Percentage of the requests served within a certain time (ms)
50% 2472
66% 3336
75% 3336
80% 3447
90% 3447
95% 3447
98% 3447
99% 3447
100% 3447 (longest request)
root@sede:/home/smurf# ab -n 100 http://demos.colivre.coop.br/criamos/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking demos.colivre.coop.br (be patient).....done
Server Software: Apache/2.2.3
Server Hostname: demos.colivre.coop.br
Server Port: 80
Document Path: /criamos/
Document Length: 114 bytes
Concurrency Level: 1
Time taken for tests: 281.637099 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 50000 bytes
HTML transferred: 11400 bytes
Requests per second: 0.36 [#/sec] (mean)
Time per request: 2816.371 [ms] (mean)
Time per request: 2816.371 [ms] (mean, across all concurrent requests)
Transfer rate: 0.17 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 259 278 25.5 274 420
Processing: 2142 2537 684.9 2197 6276
Waiting: 2108 2496 676.7 2162 6180
Total: 2403 2815 687.8 2482 6564
Percentage of the requests served within a certain time (ms)
50% 2482
66% 2669
75% 3038
80% 3206
90% 3495
95% 4146
98% 5402
99% 6564
100% 6564 (longest request)
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking demos.colivre.coop.br (be patient)
Server Software: Apache/2.2.3
Server Hostname: demos.colivre.coop.br
Server Port: 80
Document Path: /criamos/
Document Length: 114 bytes
Concurrency Level: 1
Time taken for tests: 2925.267094 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1000
Total transferred: 500000 bytes
HTML transferred: 114000 bytes
Requests per second: 0.34 [#/sec] (mean)
Time per request: 2925.267 [ms] (mean)
Time per request: 2925.267 [ms] (mean, across all concurrent requests)
Transfer rate: 0.17 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 259 275 18.6 274 660
Processing: 2139 2649 878.5 2222 13913
Waiting: 2104 2604 868.4 2185 13877
Total: 2399 2924 878.2 2504 14189
Percentage of the requests served within a certain time (ms)
50% 2504
66% 2881
75% 3186
80% 3336
90% 3833
95% 4439
98% 5143
99% 6125
100% 14189 (longest request)
Configuração 2
Agora realizando os testes no mesmo computador utilizando o mesmo link mas com a configuração descrita abaixo:
- Apache 2
- Mongrel com 2 servidores rodando.
Temos o seguinte resultado:
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking criamos.colivre.coop.br (be patient).....done
Server Software: Mongrel
Server Hostname: criamos.colivre.coop.br
Server Port: 80
Document Path: /
Document Length: 108 bytes
Concurrency Level: 1
Time taken for tests: 0.534428 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Non-2xx responses: 1
Total transferred: 503 bytes
HTML transferred: 108 bytes
Requests per second: 1.87 [#/sec] (mean)
Time per request: 534.428 [ms] (mean)
Time per request: 534.428 [ms] (mean, across all concurrent requests)
Transfer rate: 0.00 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 258 258 0.0 258 258
Processing: 276 276 0.0 276 276
Waiting: 275 275 0.0 275 275
Total: 534 534 0.0 534 534
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking criamos.colivre.coop.br (be patient).....done
Server Software: Mongrel
Server Hostname: criamos.colivre.coop.br
Server Port: 80
Document Path: /
Document Length: 108 bytes
Concurrency Level: 1
Time taken for tests: 2.827064 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Non-2xx responses: 5
Total transferred: 2515 bytes
HTML transferred: 540 bytes
Requests per second: 1.77 [#/sec] (mean)
Time per request: 565.413 [ms] (mean)
Time per request: 565.413 [ms] (mean, across all concurrent requests)
Transfer rate: 0.71 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 272 275 2.2 276 277
Processing: 288 289 1.1 289 291
Waiting: 287 288 1.2 288 290
Total: 561 564 2.6 565 568
Percentage of the requests served within a certain time (ms)
50% 565
66% 565
75% 565
80% 568
90% 568
95% 568
98% 568
99% 568
100% 568 (longest request)
root@sede:/home/smurf# ab -n 100 http://criamos.colivre.coop.br/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking criamos.colivre.coop.br (be patient).....done
Server Software: Mongrel
Server Hostname: criamos.colivre.coop.br
Server Port: 80
Document Path: /
Document Length: 108 bytes
Concurrency Level: 1
Time taken for tests: 56.673621 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 50300 bytes
HTML transferred: 10800 bytes
Requests per second: 1.76 [#/sec] (mean)
Time per request: 566.736 [ms] (mean)
Time per request: 566.736 [ms] (mean, across all concurrent requests)
Transfer rate: 0.86 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 258 274 9.9 276 302
Processing: 274 291 16.3 289 361
Waiting: 272 290 16.4 288 360
Total: 534 566 23.6 565 645
Percentage of the requests served within a certain time (ms)
50% 565
66% 567
75% 579
80% 587
90% 594
95% 600
98% 644
99% 645
100% 645 (longest request)
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.4 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking criamos.colivre.coop.br (be patient)
Server Software: Mongrel
Server Hostname: criamos.colivre.coop.br
Server Port: 80
Document Path: /
Document Length: 108 bytes
Concurrency Level: 1
Time taken for tests: 568.779394 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1000
Total transferred: 503000 bytes
HTML transferred: 108000 bytes
Requests per second: 1.76 [#/sec] (mean)
Time per request: 568.779 [ms] (mean)
Time per request: 568.779 [ms] (mean, across all concurrent requests)
Transfer rate: 0.86 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 260 275 11.5 276 341
Processing: 272 292 22.4 289 528
Waiting: 271 291 22.4 288 528
Total: 535 568 29.5 566 805
Percentage of the requests served within a certain time (ms)
50% 566
66% 567
75% 582
80% 592
90% 596
95% 603
98% 648
99% 690
100% 805 (longest request)
--
LeandroNunes - 14 Jun 2007