When do you upgrade the plan?
I have a client's Linode that has a traffic spike at random intervals at approximately 1 to 5 times a day where the CPU usage goes near 500%. The CPU spike lasts for anywhere from 15 minutes to 1 hour on each traffic spike. Other times of the day, approximately about 20 hours per day, the CPU usage is well under 50%. All are rough estimates, so not precise figures. Is it time to upgrade the plan?
When do you upgrade your Linode plans?
BTW, there is no performance lag, when the traffic / CPU goes up.
Thanks for any inputs on this.
Pothi
6 Replies
In either case, I don't think upgrading will help - the CPUs on the higher Linode plans are not any more powerful. You are probably already using the majority of the CPU on your host box during these times, so getting a higher guaranteed share likely won't help.
I can't fathom why you are unable to do so, but I will just say that running Wordpress with no caching is a VERY bad idea.
However, not caching is indeed bad. Invalidate the cache when it is going to become stale, or only cache certain page elements, but cache something. (I am not familiar with Wordpress's architecture, so it is possible that they engineered it to make both of my suggestions impossible. If so, take it out and burn it at the stake.)
Ghan_04: The host load indicator doesn't actually report anything useful; it's a bit of a placebo. The hypervisor just plain won't let a Linode use resources to the detriment of others.
If you can't do that, there are still a few things you can do:
1) Install a PHP object cache. When a PHP script is executed, PHP has to compile the script to bytecode every time it's executed. An object cache will cache the bytecode, saving a bunch of CPU time at the start of every script. This can be a substantial CPU savings, and when set up correctly, has no side-effects.
2) Verify that you're not starving your disk cache or MySQL from memory. What does your MySQL configuration look like? Does it have enough memory to do useful query caching? Does your server have enough free RAM to do proper disk caching?
3) Is the high CPU usage limited strictly to the PHP and MySQL processes? How have you configured your web server? Is it Apache with mod_php? php-fpm?
It sounds like your server is at least pretty well configured if performance isn't seriously impacted when the CPU maxes out. Don't worry about that, Linode is fine with you doing that. The only time that they ever might step in is if disk IO goes crazy, that's about the only thing you can do yourself on a linode that might impact other customers.
Thanks for your precious tips.
@Ghan_04:
I can't fathom why you are unable to do so, but I will just say that running Wordpress with no caching is a VERY bad idea.
My client runs a store in his site that also have a QA section where most (over 90%) visitors are logged-in users.
@hoopycat:
If Linode banned people for randomly and frequently using a lot of CPU, then I'd be totally screwed. Don't sweat that.
Thank you, hoopycat!
@Guspaz:
1) Install a PHP object cache. When a PHP script is executed, PHP has to compile the script to bytecode every time it's executed. An object cache will cache the bytecode, saving a bunch of CPU time at the start of every script. This can be a substantial CPU savings, and when set up correctly, has no side-effects.
I tried APC, when we transferred the site to Linode. But, for some reason, we were experiencing some errors, random downtime, etc. It could be due to bad code. I still haven't looked into the code. I only manage the server.
@Guspaz:
2) Verify that you're not starving your disk cache or MySQL from memory. What does your MySQL configuration look like? Does it have enough memory to do useful query caching? Does your server have enough free RAM to do proper disk caching?
I haven't looked at any of these.
@Guspaz:
3) Is the high CPU usage limited strictly to the PHP and MySQL processes? How have you configured your web server? Is it Apache with mod_php? php-fpm?
We use a simple Nginx => php-fpm server stack that I configured about 6 months back and haven't touched it since then (except for frequent updates).
@Guspaz:
It sounds like your server is at least pretty well configured if performance isn't seriously impacted when the CPU maxes out. Don't worry about that, Linode is fine with you doing that. The only time that they ever might step in is if disk IO goes crazy, that's about the only thing you can do yourself on a linode that might impact other customers.
Thanks so much, Guspaz. The disk IO is still well within the limit.
Pothi