Server Setup for High Load
Almost all standard configurations of servers are configured for a load no more than 200k visitors per day. If you exceed the threshold you will lose traffic because of «Too many connections». It is a problem of almost all hosters which sell empty servers. You can read some recommendations for server setup below. Although you do not get a maximum performance you can get the resistance to the increased amount of traffic.
If Redis is installed you can enable it in the settings. In this case MySQL won't be used. Installation instruction.
Run the load analyzer MySQL:
wget https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl perl mysqltuner.pl
Following the recommendations, change settings in the config /etc/my.cnf.
There is a way to slightly improve performance for shared hostings. Move the table keitaro_ips into the memory.
ALTER TABLE `keitaro_ips` ENGINE = MEMORY;
The disadvantage of this way is that if a MySQL server restarts the table will be cleared.
- Increase a value worker_processes = auto;
- Increase a value worker_connections by the formula: hour_traffic / 60 / 2;
More about the optimization nginx: http://dak1n1.com/blog/12-nginx-performance-tuning
- Move from Apache to PHP-FPM (Installation instruction);
- Increase a value MaxClients by the formula
More about the optimization Apache: http://www.ibm.com/developerworks/ru/library/l-tune-lamp-2/l-tune-lamp-2.html.
- Reduce the storage time of archival statistics as much as possible: «Referrers», «Keywords», «Source»;
- Enable fast device identification in the settings;
- If the run interval cron.php is set more than a minute change it to every minute.
Note: You can order the server configuration by our specialists: http://help.keitarotds.com/services