reducing size of apache instances

Ivan Voras ivoras at freebsd.org
Fri Sep 11 12:09:06 UTC 2009


John Almberg wrote:
> My Apache 2.2 instances are running about 18 Meg each. I've been 
> thinking about doing something to trim these down, and I think tomorrow 
> is the day to take action. They are getting out of hand.
> 
> I've done a bit of research on this. I think the way to get started is 
> to eliminate unused modules. Problem is, I know which ones I need, since 

There is another thing you can try. Judging from the process size you've 
given it looks like you are not using PHP or a similar Apache module. 
Also, you didn't specify anything so I assume you are using the default 
configuration, which operates in "prefork" mode - MPM_PREFORK, which 
means a separate process is forked for every request.

If all of this is true, you can trivially switch to the worker-threaded 
MPM in which every Apache process (which will be of comparable size to 
the one you currently have) will handle a large number of request. In 
effect, instead of e.g. 50 Apache processes active for 50 connections, 
you will have 2-3 Apache processes.

Enable WITH_MPM=worker in /etc/make.conf to enable this.



More information about the freebsd-questions mailing list