Link to home
Start Free TrialLog in
Avatar of Frontstart
Frontstart

asked on

High CPU usage

Hey I'm new to server administration and I recently moved my site to a VPS everything was fine for a few weeks, but the site has begun to go down regularly.  At these times when I check my VPS resources server usage is usually 90%+.  The entire site is written using php, javascript, and AJAX.

Could the CPU usage be causing the site to go down? and if so, do you have any tips on reducing CPU usage?

Thanks
Avatar of edster9999
edster9999
Flag of Ireland image

Remember you share the CPU with other people.
Two things can cause this issue.  

If your CPU time is hitting the max then this will slow your site(s) down and may cause it to stop responding.  Drop to the shell and run 'top' to see what is running fast.
This may be a web page that is getting into some sort of loop and using all the cpu time or it may be someone messing (hacking ?) with your site.

The other thing can be in the boxes cpu is running too hot (too busy).  If you do not see your CPU time as very high call the tech support and ask them what is going on.  It could be someone sharing your VPS is getting hacked / DDos'ed and that is impacting your site.
SOLUTION
Avatar of Linux Guru
Linux Guru
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frontstart
Frontstart

ASKER

After running top -c, It looks like two httpd processes from the apache server are at the top of the list at around 26% each, everything else is ~1%.  Those were the highest readings I could get before it went down.

Any idea what the issue could be? (restarting the server brings the site back up for a while but it just goes down again)
It could be pure load.  You have too many people to run on one VPS.
Look at your logs and work out how many hits per hour you get.
If that is the case then you need to get another VPS server or a dedicated server (or two).

If it is not high then you have bad code that is getting stuck in loops.
If this just started happening did you update the code or change anything ?

The site is still being developed so new code is added everyday, but our users also doubled around the time this started happening.  What type of numbers would be too much for a VPS?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.