I’ve had an app deployed for about six months now on Dreamhost and I’ve
recently been paying attention to the daily CPU statistics my host
provides. Since it’s a shared hosting environment there’s a
semi-arbitrary amount of CPU minutes I am allowed to use before I’m told
to pay for better hosting or find a better host. I’ve been kind of
worried lately since my site has become more popular and as result, my
CPU minutes are up. Here’s an excerpt from the log for yesterday:
Process CPU seconds user machine count average
dispatch.fcgi 1380.0600 90.150% 5.750% 229 6.026
Now based on Google Analytics that’s resultant from just under 900
unique visitors and 3,222 pageviews. So when I do the math it’s roughly
0.4CPU seconds per pageview.
I’m really not sure when my host will have a problem; I’ve read that
~50-60 CPU minutes is sort of their limit (even though they claim they
have none). I am at less than half that but I’m still fairly worried.
I’m just wondering if this is typical of Rails. I have tried to
consider what processes in my application might be CPU heavy but I can’t
think of anything. The most intensive process I can think of would be
thumbnailing uploaded images, which is really just a call directly to
My application is something like a forum (minus user registration) and
is currently about 950 lines of code.