CPU Optimization?

Just wondering if you guys could offer some Optimization tips.

Linode 1440

CPU usage is usually around 60-70% But when my traffic gets high it averages about 140%. It still runs smoothly but I don't think its fair if im constantly above my allotted 100%.

So any tips? It's a Wordpress based site - I'm running wp-supercache on it and that done a lot of good.

4 Replies

You're allotted 400% to use as you wish, not 100%. Your CPU usage is only 15-18% of available, spiking to 35%. It's not exactly at the level where you should be concerned…

Do you have MySQL set up properly with a query cache and the like? Have you tried installing a PHP cache like APC? These two things alone, if you're not doing them, can make an enormous difference.

> Do you have MySQL set up properly with a query cache and the like? Have you tried installing a PHP cache like APC? These two things alone, if you're not doing them, can make an enormous difference.

I have set up MySQL properly to the best of my knowledge. As for the query cache and APC I have no installed. Although I assume APC is like Wp-Supercache.

I shall look into this thank you (do you happen to know any ways of figuring out if MySQL was badly configured? Or how to reconfigure it on high settings.)

Okay set up APC and in the process locked myself out. Pretty sure APC has nothing to do with connections though.

@Raven917:

I have set up MySQL properly to the best of my knowledge. As for the query cache and APC I have no installed. Although I assume APC is like Wp-Supercache.
Your assumption is wrong. APC is a php opcode cacher which compiles php scripts into bytecode and caches them for faster execution.

On the contrary WP Super Cache generates static html files from WP pages reducing the time needed to serve Wordpress pages.

However I don't use neither WordPress nor APC I suggest you try using both as they can both speed up page generation (supercache pre-generates pages, but APC can speed up this pre-generation)

Before jumping in to optimize everything, run top (or htop) for a few minutes and find out which process is responsible for the majority of your CPU usage. Is it Apache or MySQL or both? Focus your efforts on the biggest offender. Also pay attention to the "wa" column near the top of the "top" output. If this figure is high, you're hitting the disk too much.

WP-Super-Cache generates static files, which Apache then serves directly without ever hitting PHP. Looks like a case where lighttpd or nginx would come in handy, if you can make the rewrite rules work properly.

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