Apache 2.2.11/Subversion memory leak

We are running a small-medium site with about 150 svn projects in a old server windows 2003/apache 2.2/svn 1.6.6. Some users reported us that the SVN server goes down. Something is wrong with the svn server: from time to time the apache service starts hogging memory and it dies with only a message:

[crit] Parent: child process exited with status 3 -- Aborting.
[info] removed PID file C:/Program Files/Apache Software Foundation/Apache2.2/logs/httpd.pid (pid=1436)

It’s not really critical if you configure the service to restart on error, but it’s annoying enough to do some further research.

Server free memory, before and after the change implementation.

free memory reported by Zabbix, as returned by perfmon (memory available) (http://technet.microsoft.com/en-us/library/cc749154.aspx)

Monitoring shows that free memory starts to run out of memory and when exhausted, apache process dies with the message below. Apache and SVN modules are 32-bits (because there is not svn modules available for win64 AFAIK), so … as apache in windows runs as a single process and spawns child threads the total memory available for apache process is limited to 2Gb. Despite the 2G limitation monitoring shows that there is enough free memory during normal operation.

Nothing appears is event viewer. Googling that problem, I found some bugs/and forums posts [1] [2]  [3], but the most complete solution is from WanDisco people that can be resumed as:

The strategy behind the above settings is to limit the life of each thread, so that if there are memory leaks, the memory gets released when the threads are killed.

In my case, settings are:

KeepAlive On
KeepAliveTimeout 30
MaxKeepAliveRequests 500
MaxRequestsPerChild 400
MaxMemFree 8192

Each thread can use to 8Mb before releasing, and service up to 200,000 requests before being killed. And, of course, swith to linux apache-subversion as soon as possible.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: