Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created May 14, 2013 11:32
Show Gist options
  • Select an option

  • Save vparihar01/5575280 to your computer and use it in GitHub Desktop.

Select an option

Save vparihar01/5575280 to your computer and use it in GitHub Desktop.
PERFORMANCE TUNING FOR PHUSION PASSENGER for production ready app.
# PassengerMaxPoolSize
# Default: 6
# For 2gb RAM: 30
# For 256 slice with MySQL running: 2
PassengerMaxPoolSize 2
# PassengerPoolIdleTime
# Recommended to be avg time per page * 2
# In Google Analytics... (Avg time on site / Avg page views) * 2
# Default: 300
PassengerPoolIdleTime 144
# PassengerMaxInstancesPerApp < PassengerMaxPoolSize
PassengerMaxInstancesPerApp 1
# Must be used with RailsBaseURI in Vhost
RailsAutoDetect off
# 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
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 1
MaxSpareServers 5
MaxClients 10
MaxRequestsPerChild 100
</IfModule>
# 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
<IfModule mpm_worker_module>
StartServers 2
MaxClients 10
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 100
</IfModule>
<VirtualHost *:80>
ServerName www.yourapp.com
DocumentRoot /home/deploy/yourapp/current/public
<Directory "/home/deploy/yourapp/current/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RailsBaseURI /
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment