Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: High CPU usage for blog
PostPosted: Thu Oct 18, 2012 11:54 pm 
Offline
Newbie

Joined: Thu Oct 18, 2012 11:48 pm
Posts: 2
I'm new to running nginx and been keeping a close watch on CPU usage, which has been hovering over 100% for a few hours. When running the top command, I get the following:

Code:
 PID USER       PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 5069 www-data  20   0 59760  32m 4508 R   22  6.5   0:17.85 php5-cgi
 5072 www-data  20   0 37076 8836 2968 R   13  1.7   0:11.64 php5-cgi
 5068 www-data  20   0 52868  26m 4844 S   12  5.3   0:17.71 php5-cgi
 5070 www-data  20   0 52940  26m 4880 S   12  5.3   0:14.64 php5-cgi
 5063 www-data  20   0 53428  26m 4176 S   12  5.2   0:18.18 php5-cgi
 5071 www-data  20   0 53408  25m 3324 R   11  5.1   0:14.01 php5-cgi


Is this normal behavior just running a wordpress blog? The graph is showing 120% CPU usage and I much prefer to keep it under 40% as it was the previous day. Any tips? So far I've enabled WP Super Cache.

Thanks.


Top
   
PostPosted: Fri Oct 19, 2012 12:38 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Keep in mind that you have four processors available, so 400% CPU is the max.

As you noted, some caching plugins can reduce CPU activity by storing the results of previous computations. To reduce it further, you may want to search for discussions about any other plugins you're using and see if any are well-known CPU hogs.


Top
   
PostPosted: Fri Oct 19, 2012 4:19 am 
Offline
Junior Member

Joined: Sun May 06, 2012 2:30 pm
Posts: 25
Location: San Diego, California
Do you have an opcode cache installed? If not, install APC or XCache.


Top
   
PostPosted: Mon Oct 22, 2012 5:23 am 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:35 pm
Posts: 111
Location: United Kingdom
You might want to switch to php-fpm rather than php-cgi.

You could also use Nginx's FastCGI cache to reduce load a lot as well as massively improving the speed of your blog to visitors.


Top
   
PostPosted: Thu Oct 25, 2012 12:05 pm 
Offline
Newbie

Joined: Thu Oct 18, 2012 11:48 pm
Posts: 2
I've installed APC and so far it seems to have calmed down quite a bit! I'm sure most if not all the pages have been cached by now. Much appreciative of your guys suggestions.

Image

With regards to php-fpm is it a simple switch over from php-cgi? I'm a bit nervous testing it on a production server as I haven't worked with it before.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group