dovrei ottimizzare un server Web affinchè supporti un carico stimato di:
- 100.000 visitatori unici al giorno;
- 20.000 visitatori unici in contemporanea(picco);
- Connessioni ADSL casalinghe;
Tutto il traffico sarà direzionato verso un'unica pagina con collegamenti ad altre 11 pagine statiche dal peso di circa 315 KB ognuna.
Non è presente MySql nè pagine dinamiche.
La macchina è così fatta:
DELL R610
2 CPU intel Xeon L5520 (http://ark.intel.com/Product.aspx?id=40201)
8 GB RAM
connettività flat 100 Mbit/s (garantiti 100%)
Linux CentOS 64bit
4 x 146 GB SAS Raid 5
Ho provato ad ottimizzare un pò apache, questa una parte dell’httpd.conf:
Codice: Seleziona tutto
Timeout 60
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 150
MinSpareServers 100
MaxSpareServers 256
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 10000
KeepAlive On
KeepAliveTimeout 2
MaxKeepAliveRequests 200
</IfModule>
<IfModule worker.c>
StartServers 10
MaxClients 150
MinSpareThreads 50
MaxSpareThreads 100
ThreadsPerChild 50
MaxRequestsPerChild 0
KeepAlive On
KeepAliveTimeout 15
MaxKeepAliveRequests 1000
</IfModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-httpd-php application/x-httpd-fastphp
DeflateCompressionLevel 9
<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot "/var/cache/mod_proxy"
</IfModule>
Nel seguito un test fatto da un altro server verso l’url definitivo.
Codice: Seleziona tutto
ab -n 20000 -c 1000 <URL>
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 <URL> (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 10000 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Completed 20000 requests
Finished 20000 requests
Server Software: Apache
Server Hostname: <URL>
Server Port: 80
Document Path: /
Document Length: 8961 bytes
Concurrency Level: 1000
Time taken for tests: 16.443 seconds
Complete requests: 20000
Failed requests: 0
Write errors: 0
Total transferred: 182808688 bytes
HTML transferred: 179228330 bytes
Requests per second: 1216.30 [#/sec] (mean)
Time per request: 822.165 [ms] (mean)
Time per request: 0.822 [ms] (mean, across all concurrent requests)
Transfer rate: 10856.95 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 13 181 653.9 69 9090
Processing: 16 456 857.7 217 9100
Waiting: 8 387 856.1 154 8996
Total: 85 637 1061.5 315 11353
Percentage of the requests served within a certain time (ms)
50% 315
66% 404
75% 468
80% 501
90% 1117
95% 3217
98% 4459
99% 4554
100% 11353 (longest request)
Purtroppo, per vari motivi, non ci è possibile implementare un'architettura più stabile..
Potreste darmi consigli sull’ottimizzazione e su uno o piu’ tool di stress test che mi configurino il momento peggiore (20.000 utenti unici in contemporanea sul sito) così da fare opportune verifiche prima della messa online ?
Grazie mille.