On Sat, Sep 06, 2014 at 05:46:58PM +0100, James Wade wrote:
It's CentOS 6.5, running ZPanel and Wordpress...
That's it.
I generally recommend against installing any sort of "panel"
software like CPanel, because they replace standard system binaries
and configurations leading you into a situation where you only know how
to administer the panel software, not a Linux system. I've never
heard of ZPanel and have no idea if it's anything like CPanel; I
hope not.
Out of memory: Kill process 11946 (httpd) score 28 or
sacrifice child
Killed process 11946, UID 48, (httpd) total-vm:85420kB,
anon-rss:6864kB, file-rss:56kB
Can we see the current header from "top" please?
Can we see the output of:
ps -C apache2 -FH
(may have to do "-C httpd" if apache binary is called httpd on
CentOS; I forget)
Finally this one will give us all processes sorted by how much
memory they are using:
ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr
For a quick look, put a "head" on the end:
ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head
The typical strategy here will be:
1. Disable any apache2 modules that you don't need and restart
apache2.
2. See how big a single apache2 worker process is. Call that A.
3. See about how much memory you have left. Call that F.
3. F divided by A is how many apache2 workers you can have running
at once without the server going into swap. Make sure that
MaxClients and StartServers are <= that number.
For example, if you have about 120M of spare memory and each Apache
child is using about 24M of virtual memory then try setting
MaxClients to 5, StartServers to 2 and MinSpareServers to 1. In
Debian these settings would be found in /etc/apache2/apache2.conf.
If you had mistakenly set MaxClients to say, 20, then 20x24=480M so
host goes into swap, every grinds to a halt. By restricting the
number of apache2 workers you just make web serving slow. Which is
still not great, but is better than everything being unusable.
For greater performance, switch to something like lighttpd or Nginx
with PHP as a pool of FastCGI processes.
Cheers,
Andy
--
http://bitfolk.com/ -- No-nonsense VPS hosting