Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Feb 01, 2014 5:05 pm 
Offline
Senior Newbie

Joined: Fri Jun 07, 2013 3:27 pm
Posts: 11
I'm running a fairly trafficed (wordpress / LAMP) site, that seems to get random spikes on the IO graph. (Attached)
Image

Being new to the server game I'm almost positive I shouldn't be seeing this much swap happen. (But maybe I should?) Usually when I get a spike I get a error from wordpress establishing a database connection (not sure if that would be a clue or not?).

Any help is much appreciated!


Top
   
PostPosted: Sat Feb 01, 2014 5:15 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Your swapping too much, search the forum for Apache MaxClients there's plenty on posts on it and it's probably your problem. If that doesn't work let us know.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Sat Feb 01, 2014 5:24 pm 
Offline
Senior Newbie

Joined: Fri Jun 07, 2013 3:27 pm
Posts: 11
Code:
<IfModule mpm_prefork_module>
    StartServers          2
    MinSpareServers       6
    MaxSpareServers      12
    MaxClients           40
    MaxRequestsPerChild   3000
</IfModule>



I had it set to 40 on a 1024 Linode, guess that would be to much? From what I just read through it's seems 50 and below *should be ok?


Top
   
PostPosted: Sat Feb 01, 2014 5:40 pm 
Offline
Senior Newbie

Joined: Fri Jun 07, 2013 3:27 pm
Posts: 11
Here's the rest of my settings, maybe something here is a little high?

MySQL:
Code:
max_connections = 75
key_buffer = 32M
max_allowed_packet = 1M
thread_stack = 128K
table_cache = 64


PHP:
Code:
max_execution_time = 30
memory_limit = 256M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
log_errors = On
;error_log = php_errors.log
register_globals = Off


Top
   
PostPosted: Sat Feb 01, 2014 6:03 pm 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
40 clients with prefork is waaay too much for a 1024. Try 10-15


Top
   
PostPosted: Thu Apr 03, 2014 7:21 pm 
Offline
Newbie

Joined: Thu Apr 03, 2014 7:16 pm
Posts: 3
Did you solve your problem? I'm having a similar issue with high I/O spikes periodically, without correlation to network traffic. I'm on a 2048 linode, and have settings similar to the ones you listed.

I'm particularly interested in the recommendation to back off from 40 clients with prefork to 10 to 15, as I've got mine set at 80, which was the linode how-to's recommendation for a 2048 (i.e. doubling the 1024's 40). So I'm wondering if you tried that, and if that helped.

Thanks!


Top
   
PostPosted: Fri Apr 04, 2014 7:03 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
80? o_O With apache prefork you really don't want that. You'll go oom, start swapping and indeed get lots of I/O during that time.

I would say the Linode Guide is wrong. Maybe they meant 8 or something, not 80.

You'd be better of with nginx, especially if you need 80 clients.


Top
   
PostPosted: Thu Apr 24, 2014 1:33 pm 
Offline
Newbie

Joined: Thu Apr 03, 2014 7:16 pm
Posts: 3
@Nuvini: thanks for the comment.

From the comments in this thread, I scaled back maxclients from 80 to 40.

I ran the "apachememoryusage.sh" script before and after the change to see how Apache's memory utilization looked with both settings. With maxclients at 80, Apache memory usage was 740MB (under light loading) and average process size was 56MB. Then, with maxclients at 40, and after half a day running that way, Apache memory usage was at 833MB (under moderate loading) and average process size was 64MB. After several weeks with the reduced maxclients setting, my site's OOM problems appeared to have gone away.

That was on a 2GB Linode that had 2GB RAM plus 8 shared CPU cores. Last week, the Linode dashboard informed me that those 2GB Linodes were getting migrated to a new 4GB configuration that had 4 shared CPU cores, and I upgraded my site to the new Linode style with 4GB RAM. I suspect this larger RAM allocation will make the 40 maxclients setting even safer, but will report back if any more OOM problems arise.


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


Who is online

Users browsing this forum: No registered users and 6 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