Gnuru.org
Productive Linux


Subscribe

 Subscribe in a reader

Enter your email address:

Delivered by FeedBurner


Limiting Memory of Apache Processes
4 November 2008 @ 11:59 GMT
by Paul

Note to self.

If you're running Apache and mod_perl2 on a server with limited memory, you can manage the resources the server uses with Apache2::SizeLimit.

To ensure that as much memory as practical is shared, the $Apache2::SizeLimit::MIN_SHARE_SIZE variable should be set. As well as setting the PerlCleanupHandler to Apache2::SizeLimit.

Update: I've found that best performance can be had not by setting the variables mentioned above, but by setting the $Apache2::SizeLimit::MAX_UNSHARED_SIZE variable. This is explained in the Apache2::SizeLimit man page:

Experience on one heavily trafficked mod_perl site showed that setting maximum unshared size and leaving the others unset is the most effective policy. This is because it only kills off processes that are truly using too much physical RAM, allowing most processes to live longer and reducing the process churn rate.


Leave a comment:

Are you human?