Tweak I-mscp for high traffic websites.

  • I have some problems with one of our servers that is hosting a high traffic website. To be more exact, from time to time with no reason php5-fm dies and the quick fix is to restart the process.
    I wonder what can we tweak to optimize the server for such a big task.


    A part of the apache2 error log is,


    Code
    1. [Sat Sep 27 13:10:58.013184 2014] [fastcgi:error] [pid 23562:tid 139667001292544] (2)No such file or directory: [client 74.6.254.101:39370] FastCGI: failed to connect to server "/var/lib/apache2/fastcgi/php5-fcgi-domain.tld": connect() failed[Sat Sep 27 13:10:58.013245 2014] [fastcgi:error] [pid 23562:tid 139667001292544] [client 74.6.254.101:39370] FastCGI: incomplete headers (0 bytes) received from server "/var/lib/apache2/fastcgi/php5-fcgi-domain.tld"[Sat Sep 27 13:10:58.048675 2014] [fastcgi:error] [pid 23562:tid 139666883794688] (2)No such file or directory: [client 68.180.225.108:15248] FastCGI: failed to connect to server "/var/lib/apache2/fastcgi/php5-fcgi-domain.tld": connect() failed[Sat Sep 27 13:10:58.048726 2014] [fastcgi:error] [pid 23562:tid 139666883794688] [client 68.180.225.108:15248] FastCGI: incomplete headers (0 bytes) received from server "/var/lib/apache2/fastcgi/php5-fcgi-domain.tld"[Sat Sep 27 13:10:58.079957 2014] [fastcgi:error] [pid 23562:tid 139666808260352] (2)No such file or directory: [client 5.14.222.14:1419] FastCGI: failed to connect to server "/var/lib/apache2/fastcgi/php5-fcgi-domain.tld": connect() failed, referer: https://www.google.ro/[Sat Sep 27 13:10:58.080007 2014] [fastcgi:error] [pid 23562:tid 139666808260352] [client 5.14.222.14:1419] FastCGI: incomplete headers (0 bytes) received from server "/var/lib/apache2/fastcgi/php5-fcgi-domain.tld", referer: https://www.google.ro/


    The configuration is a cloud server with 8vcpu, 16GB RAM, SSD Storage.
    Software. Ubuntu 14.04LTS, Apache 2.4.7, PHP 5.5.9, I-mscp 1.1.14
    The website is a Wordpress installation. Traffic of the site is around 10.000 -18.000 unique visitors, and I saw a peak on the 480 simultaneous visitors. Most of the time there are ~100 simultaneous visitors.
    I use also memcache and local CDN (w3 total cache plugin) to make the website snappy.


    PHP Settings for this domain,

    Code
    1. post_max_size directive 512MBupload_max_filesize directive 32MBmax_execution_time directive 240 secmax_input_time directive 480 secmemory_limit directive 2046MB


    Apache tuning, that I have done in apache2.conf

    Code
    1. Timeout 600 (default was 300)MaxKeepAliveRequests 300 (default was 100)


    Rest of the apache2 settings are default.


    I did some tuning also on /etc/apache2/mods-available/mpm_worker.conf

    Code
    1. <IfModule mpm_worker_module>
    2. StartServers 4
    3. MinSpareThreads 50
    4. MaxSpareThreads 150
    5. ThreadLimit 128
    6. ThreadsPerChild 50
    7. MaxRequestWorkers 800
    8. MaxConnectionsPerChild 0
    9. </IfModule>


    Any suggestions? Thanks!

  • Hello ;


    I'll try to give an answer this evening. Sorry for the delay my friend ;)


    BTW: I love to see such a thread wich bunch of information. This really help us ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • It's OK. I'm using a dirty hack to "fix" the problem, for the moment. I'm waiting for any reply. :)


  • this way of "optimization" is a deadway:)
    @ a "bigger" trafic like that:
    your server have not enough time to respond:)...
    if you open a page on any site hosted on server after a long time(aprox 20-30sec) just simply get an ERROR 500 or not respond...
    php5-fpm restart is just a "temporary" solution.
    Why i write "temporary"?...because after restart the clients is reconnecting and "failure" is back.
    But this thing is NOT a failure just a simply "bad" setting of system.


    /*daca vrei, pentru niste bani iti zic ce trebuie sa faci sa nu "moare" serverul*/

  • Thanks for the answer, there was no problem about the settings, it was a OPcache issue. I disabled it and now works fine. There was no Error 500, php5-fpm process was just dying.
    Thread is still open to suggestions on how to improve performance of a i-mscp server for large traffic websites. Who want's to share it to the community, off-cause.


    PS: We are on an international area of the forum, please write in English. Needforszpit was suggesting to share the information on private, for some money.

  • @Delta04


    Seriously? He ask money for sharing its settings???

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • I will translate this from Romanian to English (you can try it too, with Google translate or some other tool).


    /*daca vrei, pentru niste bani iti zic ce trebuie sa faci sa nu "moare" serverul*/
    /*if you want, for some money I will tell you what to do, so your server will not "die" */


    I got no problem with the idea of a paid service, the problem is that he addressed me in my mother language, on an international forum.