When do you upgrade the plan?

Hello,

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

It's important to know what's causing the CPU spikes. If you know that, you might be able to find a way to fix that without upgrading hardware.

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.

Thanks for your suggestion, Ghan_04. We actually use WordPress without any caching. We can't use caching. That's why when the traffic goes up, the PHP and MySQL usage goes crazy. So does CPU. I wonder, if Linode would ban us outrightly without informing us. We have been using Linode for over 6 months, but the CPU spike is a recent thing (probably since the start of this month). My client is happy to upgrade, if Linode requires us, though.

Upgrading your Linode plan won't do any good unless other users on your box are also slamming the CPU. The Linode Manager tells you how much usage the host box is experiencing - check it a few times when your Linode isn't using a lot of CPU and see what it says. If it's "Idle" or "Low" then there's absolutely no point in upgrading your plan. If you want to get better CPU performance, get a dedicated server.

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.

If Linode banned people for randomly and frequently using a lot of CPU, then I'd be totally screwed. Don't sweat that.

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.

Are you sure you can't use caching? I can't think of any scenario that would prevent you from using caching, since a wordpress cache will refresh the cache if anything changes.

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.

Hi all,

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. :oops:

@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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct