My site is currently running on a VPS and I am experiencing problems with the server load; there are 4 cpus but use is spiking to 10 or higher. How do I find out what is causing this?
It's a Linux server. As to looking at the processes, I don't know. How would I go about doing that? I know next to nothing about running a server.
ssh in and type "ps -ax" (without quotes) or you can just type "top" (without quotes) to see the processes in realtime. That should give you some clues.
you must have a shell account. If you have access to a VPS most likely you are given an access. use a shh client such as putty http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html type in your server's ip address or hostname in putty, open it and u should see a login prompt. Now login and check the processes.
Okay, I've got a whole list of stuff now. The server is (currently) not overloading. What should I look for when it does?
runing your "top" and you should see realtime processes. Look at the cpu% and mem left. that should give you an idea of an overloading server. If it looks overload go to the list. The heavier processes are at top and may be unusually high. Now that should give you some idea what kinda task is eating up your resources. httpd, mysql, mail? etc..
A few times whilst I was watching httpd went to the top, by the looks of things, when the server started overloading according to cpanel status. What is httpd?
httpd is your web service. Apache http daemon... Check your web log. it may show something... I would run "ps -ax" to look at the unusual httpd then a "netstat -a" to look at the httpd again. You would get worried if there are hundreds to thousands of httpd going on and off at 1 time because that could signify a DDOS attack.
Is the TIME+ column the total time a process has been running? Because, if so, 2 of the httpd processes have been running for over 10 hours.
I ran ps -ax and got the following message: Warning: Bad syntax, pehaps a bogus '-' Followed by a whole bunch of stuff in columns: PID TTY STAT TIME COMMAND Running netstat -a brought up yet more stuff.
that's normal. some httpd processes will get stucked on bad script. just kill the proccess by typing "kill pid" where pid is the process id you see as numbers on the left column. "ps -ax" should give u a static list. Look for the one with an unsual long time then kill it!
Hi if you run awstats in a bussy server its not unusual that cpanel reports high server load. Keep checking top every now and than. If you see .pl processes hogging server its probably awstats. It is not serious as it runs on a low prio so httpd processes will always get priority ( thats web site requests) You can ask the server guys to adjust some settings for you do the effect is less. Had a similar issue on of my dedicated and the server guys sorted it. Hope it helps Expat
So, to stop those two processes I kust type the following commands: kill 5605 kill 5638 Can anything bad happen to my server by doing this?
If you think there is bogus script doing that to your server. compare the httpd logs with your unusual processes. i believe your logs are in /var/log/httpd yes.. you can kill the suspects this way or "killall httpd" and restart your apache