Which apache worker to use with passenger and how?

43 views
Skip to first unread message

millisami

unread,
Jul 7, 2009, 8:22:20 PM7/7/09
to Phusion Passenger Discussions
I've this config in my apache2.conf

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<pre># 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</pre>
<IfModule mpm_worker_module>
StartServers 2
MaxClients 15
MinSpareThreads 4
MaxSpareThreads 5
ThreadsPerChild 15
MaxRequestsPerChild 50000
</IfModule>
Now I'm confused here.

* Which module gets loaded on which conditions?
* The phusion guys have suggested to use the worker module. Since both
are present in apache conf file, do I have to comment the
mpm_prefork_module or leave it as it is?

Following is my passenger conf file for apache:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/
passenger-2.2.4/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4
PassengerRuby /usr/bin/ruby1.8
PassengerMaxPoolSize 3
PassengerPoolIdleTime 999999
RailsFrameworkSpawnerIdleTime 0
RailsAppSpawnerIdleTime 0

* I'm running just a single Rails 2.3.2 app on 256MB slice at
slicehost. I'm not quite satisfied with the performance yet. Are the
settings above are any good??

Scott Smith

unread,
Jul 7, 2009, 9:03:40 PM7/7/09
to phusion-...@googlegroups.com
millisami wrote:
> I've this config in my apache2.conf
>

The MPM directives in your httpd.conf are enclosed within IfModule
conditionals, which means they are only evaluated if the module is loaded.

You can find out which MPM your installation is currently using by
running the httpd command with the -l flag, e.g.:

/usr/sbin/httpd -l

It should show you something like `prefork.c' or `worker.c'.

-scott

Reply all
Reply to author
Forward
0 new messages