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.

Enable Redis

If Redis is installed you can enable it in the settings. In this case MySQL won't be used. Installation instruction.

MySQL

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.

Execute SQL:

ALTER TABLE `keitaro_ips` ENGINE = MEMORY;

The disadvantage of this way is that if a MySQL server restarts the table will be cleared.

Nginx

  • 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

Apache

More about the optimization Apache: http://www.ibm.com/developerworks/ru/library/l-tune-lamp-2/l-tune-lamp-2.html.

TDS Settings

  • 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