Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: OOMing
PostPosted: Thu Apr 28, 2011 7:24 am 
Offline
Senior Newbie

Joined: Thu Mar 31, 2011 11:12 am
Posts: 5
Hi,

My Linode is OOMing frequently.

I have followed the instructions as stated in "Troubleshooting Memory Issues" in the Linode Library but to no avail.

The culprit is Apache. How can I know what is causing the problem and the way to fix it ? Can someone update on this ASAP?

Thanks
Ravi


Top
   
 Post subject:
PostPosted: Thu Apr 28, 2011 7:33 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
What size is your linode?
How are you running apache (prefork/worker?)
What is the contents of your apache configuration file?

_________________
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
   
 Post subject:
PostPosted: Thu Apr 28, 2011 8:32 am 
Offline
Senior Newbie

Joined: Thu Mar 31, 2011 11:12 am
Posts: 5
Apache is running as prefork.
Size of the Linode is 16GB.

Contents of apache2.conf are as below :

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 3
MaxSpareServers 6
MaxClients 24
MaxRequestsPerChild 3000
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

Thanks
Ravi


Top
   
 Post subject:
PostPosted: Thu Apr 28, 2011 9:03 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
edit
Code:
<IfModule mpm_prefork_module> 
StartServers 1
MinSpareServers 3
MaxSpareServers 6
MaxClients 24
MaxRequestsPerChild 3000
</IfModule>


to look like

Code:
<IfModule mpm_prefork_module> 
StartServers 1
MinSpareServers 1
MaxSpareServers 2
MaxClients 5
MaxRequestsPerChild 3000
</IfModule>


That will keep apache to a maximum of 5 processes, assuming a process uses 40MB of ram that's 200MB out of your 512 it can use leaving plenty for other processes and caching.

_________________
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
   
 Post subject:
PostPosted: Thu Apr 28, 2011 12:16 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
As @obs said, try lowering MaxClients. But you might not need to push it all the way down to 5. 10 should be just fine unless you have a really problematic script (eg. a heavyweight WordPress plugin). Try various numbers and find the one that works best.

Also, change KeepAliveTimeout to something really low, like 2.


Top
   
 Post subject:
PostPosted: Fri Apr 29, 2011 3:28 am 
Offline
Senior Newbie

Joined: Thu Mar 31, 2011 11:12 am
Posts: 5
Thanks a lot. I guess the problem is resolved as I have not faced a problem till now.


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


Who is online

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