CPU Minutes Complaint from Dreamhost Support running Debian
Hi,
I wondered if someone could answer a question regarding CPU minutes? My hosting provider (Dreamhost) runs Linux (Debian) and I got a mail last week stating I am using what they claim to be an unreasonable amount of system resources. Quote:
OK, so I checked out the resource usage files and here are some example of the output: Quote:
I have done some reading about this and found out about dividing the TOTAL by 60 to put it into minutes, but still do not grasp this concept. Does the average (in the right-most column) mean that the average 'actual usage' over the 24 hour reporting period? And how does the php.cgi have so many seconds and an average of 0.096, but Perl has a lower amount of seconds but have a higher average of 29.743? I'm assuming that php.cgi is using touching the CPU many times but using a fraction of it's capacity and Perl (from my Awstats installation) is using fewer seconds but when it does run it uses more of the CPU? If my above assumption is true, it the whole message from my host unreasonable on their part? Or is it a bad attempt to 'sell up' the customer to a dedicated box? My traffic has always been fairly constant and I have never been told my usage is unreasonable from any hosting provider before. Furthermore, they have a 3 month 'cancellation/money back period'. They conveniently starting notifying me 2 days outside of it - as if my usage one day all of a sudden got big! Any advice anyone has to offer will be appreciated. I apologise in advance if this is not the right forum for this type of message. I am just interested in finding out what this all means. |
CPU time is the amount of time the processor has had to give to a particular task. With many programs running at once, and CPUs able to do a lot of things in a pretty short space of time, CPU time should be relatively small, even for a busy program.
I'm not sure if you're running Linux yourself or not? You didn't say. If you are, the best way to find out about CPU minutes is to run the "top" program, which shows a list of programs that are running, and how much CPU usage they're taking up (Windows has the task manager, which does a similar job, but I forget whether it shows CPU minutes). If you run "top", you'll see a column called TIME, which is the number of CPU minutes that a program has taken since it started. For example, on my computer at the moment, Firefox (which as been running all day) has used up 8 minutes and 58 seconds of CPU time so far. You said your traffic is consistent, but you didn't give an idea of how much you're getting, so it's hard to say for sure whether 75 mins of CPU usage in a day is excessive for you, but it certainly does sound like a lot. For a reasonably quick-running page, you'd need to be getting tens of thousands of page hits per day to get that sort of usage. A PHP or Perl program should run and complete almost immediately (web users don't like to be kept waiting), so it shouldn't use very much CPU time at all -- a hundredth of a second or less each time it runs would be typical; anything more than a tenth of a second will produce noticeable delays (possibly even time-outs) for the web users. If it's using much more than that, it implies that the program has a very processor intensive loop somewhere in it, which probably doesn't need to be there: remove or simplify the loop, and the problem will go away. If this is a PHP program you've written yourself, have a look at the loops, and see if there's anything that might cause it to go slowly. I hope that helps... :) All the best, Spudley. (ps -- if you want to make your stats easier to read, use the [code] tag instead of [quote] :) ) |
Hi Spudley,
Yeah, I'm running FC4 at home, and am familiar with 'top', but I wondered if what is deemed to be a CPU minute could be either a program or process that could spend say 8 hours consuming 0.01% of the CPU or 99% of the CPU - and both would be counted in the same way even though the actual performance of the box would be totally different in the two examples. As for the site and traffic, its a phpBB installation (slightly modded). Here is a summary of the stats for November: Unique visitors 15449 Number of visits 37297 Pages 1282558 (34.38 pages/visit) Hits 2,682,957 Bandwidth 6.28 GB Coupled with the php usage from my original message (above) Process php.cgi CPU seconds 4364.2100 user 97.764% machine 18.184% count 45498 average 0.096 Does the average mean I am using just under 1% of the CPU all the time? If so, I really dont think that's so much load. They recommended a way for me to fork out which scripts are using more of the CPU resources. I don't mind doing that but before I do, I wonder if it is really worth it as if that CPU usage v's amount of traffic is 'normal' for a phpBB installation then it will be a waste of time. What do you reckon? |
Hi again,
Quote:
Quote:
Now I know from first hand experience the sort of strain a really busy forum can put on a web server -- a friend of mine runs a very popular forum, and he's had to pay for a dedicated server to run it, because it was breaking various bandwidth/usage limits on the shared server where he started it. I haven't got his stats to hand, so I can't compare them to yours (and of course, your actual server is likely to be different from his too), but he was forced to move when his forum started getting about 100-150 new posts per day. Quote:
Quote:
If you can find a phpBB mod that allows you to cache pages it will help with the CPU load -- save yourself a bit of database traffic if lots of people are viewing the same page at the same time. Other than that, I'm not sure. Hope I've been of some help, though. |
Hello Spudley,
Yeah, thanks. Thats loads of help. At least I know where I stand. I am a total n00b when it comes to site usage v's machine resource usage - this year the forum's popularity has really mushroomed which on the one hand is great, but on the other hand I am now likely to incur greater financial costs (dedicated server) or risk having to shut up shop (perfer not to). I've just never been in this position before and I felt that dreamhosts mail was perhaps a little 'untimely' and contrived (sent 2 days after the 90 day cancellation period). Anyways, you have a good weekend and thanks for your help! I'm off out to the company christmas piss up ;-) Cheers, Mr Wobble PS already installed xs_mod which does caching. Unfortunately it didnt really make any kind of a dent (reduction) in the processor usage. |
All times are GMT -5. The time now is 12:19 PM. |