On a ubuntu server, I run a LAMP environment with APC, and fast-cgi as php mod, to host 2 wordpress sites, and both sites have Wordpress Total Cache (W3TC) plugin configured.
The server's specs are: 2gb ram and 1 cpu (cpu MHz: 2100.076, cache size: 2048 KB).
One of the sites, generates a pretty heavy load on the server and oftenly the server stops to respond because of the high load.
- I've deactivated unused Apache modules
- I have set that all the caching from W3TC to be done in memory with APC
- I did some apache tweaking
But none of that actually helps me with the brutal CPU usage, from php-cgi
.
While I implement varnish and try to have a replica on another server I have so I can also do some load balancing, I'm wondering how can I set some kind of load limit on php-cgi
or apache
its self, and show a custom message like: Sorry, the server is under heavy load, please try again later
Have to mention that I also use, cloudflare.
Any other tips, are very welcome as well.