PDA

View Full Version : How to reduce CPU usage



Offgridder
03-21-2008, 06:03 PM
We have recently increased traffic sharply, and have fallen foul of the rule to keep CPU below 2%.

I need to get this reduced quickly

Can anyone help please?

WestHost - DWinans
03-21-2008, 06:19 PM
Dear Nick,

The following link should give you some tips on reducing resource consumption.

http://members.westhost.com/reducing-resources.html

Offgridder
03-21-2008, 06:33 PM
I was wondering if there is anyone there I could pay to sort it out for me? I don't really have the skills. It probably shoudl not be too complex.

WestHost - DWinans
03-21-2008, 09:11 PM
Dear Nick,

West Host does have a Custom Services department. If you would like assistance you can submit a request via https://corp2.westhost.com/customservices/ They will respond with an estimated quote of the cost it would take to complete the work.

Offgridder
03-22-2008, 02:22 PM
It turns out that the problem is that we are a reasonably successful website, and the amount of traffic is causing an undue load on the CPU.

but I am confused. We have only used about 10% of our bandwidth allowance for the month, yet apparently we have exceeded our CPU allowance by 400% - how can this be?

godrockzzz
03-23-2008, 11:10 AM
It turns out that the problem is that we are a reasonably successful website, and the amount of traffic is causing an undue load on the CPU.

but I am confused. We have only used about 10% of our bandwidth allowance for the month, yet apparently we have exceeded our CPU allowance by 400% - how can this be?
wow! I'm curious to hear the reasoning for that as well

WestHost - DWinans
03-23-2008, 10:15 PM
Just a few factors I can think of off the top of my head that could affect CPU usage without affecting bandwidth.

1. Looping scripts or scripts that do not terminate.
2. Non Indexed Databases.
3. Poorly Developed MySQL Statements.
4. Poorly developed code.
5. Various Apache Configuration settings.
6. Small pages getting hit many times in short time periods.

With this issue we are talking about 2 different things that are not always related. There isn't a rule stating that X amount of CPU resource utilization amounts to X amount of bandwidth usage. Bandwidth is a measure of the amount of information or data that can be sent over a network connection in a given period of time. The CPU executes any processes or functions you're VPS executes, which will include processes that do not need to send data over a network connection to process.

wildjokerdesign
03-24-2008, 07:38 AM
I have the feeling that the biggest culprit in this case are PHP programs that are poorly written or simply need a large amount of CPU to function. Sometimes installing eAccelerator can help but not always depending on the program. Many PHP programs actually have built in caching available but often rely on functions not available to us. In theory installing EA should help even these programs but perhaps you could get some added benifit by looking into manually installing the functionality needed for the PHP programs caching ability.