OOMing
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
5 Replies
How are you running apache (prefork/worker?)
What is the contents of your apache configuration file?
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
MinSpareServers 3
MaxSpareServers 6
MaxClients 24
MaxRequestsPerChild 3000
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
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
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
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestsPerChild 0
These need to be set in /etc/apache2/envvars
User ${APACHERUNUSER}
Group ${APACHERUNGROUP}
Thanks
Ravi
to look like
````
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.
Also, change KeepAliveTimeout to something really low, like 2.