Use passenger-memory-stats while your app is loaded to see how your system handles your session settings. We use the –max-pool-size 50 option to limit the number of passenger sessions that connect to our RoR application. Here are the stats under load:
root:/usr/local/bin# passenger-memory-stats ------------- Apache processes ------------- *** WARNING: The Apache executable cannot be found. Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename. --------- Nginx processes ---------- PID PPID VMSize Private Name ------------------------------------ 25528 1 5.3 MB 0.1 MB nginx: master process /usr/local/nginx//sbin/nginx -c /usr/local/nginx/conf/nginx.conf.journal 25529 25528 5.3 MB 0.2 MB nginx: worker process 25531 1 6.0 MB 0.2 MB nginx: master process /usr/local/nginx//sbin/nginx 25532 25531 6.8 MB 1.1 MB nginx: worker process 25534 25531 6.8 MB 1.1 MB nginx: worker process 25753 1 4.7 MB 0.1 MB nginx: master process /var/lib/passenger-standalone/3.0.0-i686-ruby1.8.7-linux-gcc3.4.5-1002/nginx-0.8.52/sbin/nginx -c /tmp/passenger-standalone.25533.conf 25754 25753 7.3 MB 2.8 MB nginx: worker process 25975 1 4.7 MB 0.1 MB nginx: master process /var/lib/passenger-standalone/3.0.0-i686-ruby1.8.7-linux-gcc3.4.5-1002/nginx-0.8.52/sbin/nginx -c /tmp/passenger-standalone.25756.conf 25976 25975 5.0 MB 0.5 MB nginx: worker process ### Processes: 9 ### Total private dirty RSS: 6.12 MB ----- Passenger processes ------ PID VMSize Private Name -------------------------------- 11041 123.2 MB 109.9 MB Rack: /opt/mcjr 17836 34.0 MB 27.1 MB Passenger ApplicationSpawner: /opt/mcjr 18260 51.7 MB 36.7 MB Rack: /opt/mcjr 18264 50.5 MB 35.6 MB Rack: /opt/mcjr . . . 18491 51.1 MB 36.1 MB Rack: /opt/mcjr 18496 50.9 MB 35.9 MB Rack: /opt/mcjr 25541 4.2 MB 0.2 MB PassengerWatchdog 25543 52.7 MB 8.2 MB PassengerHelperAgent 25544 8.9 MB 6.3 MB Passenger spawn server 25547 5.1 MB 0.3 MB PassengerLoggingAgent 25763 4.2 MB 0.2 MB PassengerWatchdog 25765 52.2 MB 2.6 MB PassengerHelperAgent 25766 7.9 MB 5.3 MB Passenger spawn server 25769 5.1 MB 0.3 MB PassengerLoggingAgent 29687 54.4 MB 41.1 MB Rack: /journal/rails ### Processes: 60 ### Total private dirty RSS: 1991.48 MB |
We are using up close to 2GB of RAM with our configuration under load. Here are the stats idle:
root:/usr/local/bin# passenger-memory-stats . . . ---- Passenger processes ----- PID VMSize Private Name ------------------------------ 18300 53.1 MB 39.7 MB Rack: /opt/mcjr 25541 4.2 MB 0.2 MB PassengerWatchdog 25543 52.7 MB 8.2 MB PassengerHelperAgent 25544 8.9 MB 6.4 MB Passenger spawn server 25547 5.1 MB 0.3 MB PassengerLoggingAgent 25763 4.2 MB 0.2 MB PassengerWatchdog 25765 52.2 MB 2.6 MB PassengerHelperAgent 25766 7.9 MB 5.3 MB Passenger spawn server 25769 5.1 MB 0.3 MB PassengerLoggingAgent 29687 54.4 MB 41.1 MB Rack: /journal/rails ### Processes: 10 ### Total private dirty RSS: 104.27 MB root:/usr/local/bin# |
Note that we haven’t benchmarked the rendering since we were on Mongrel, but at that time the extra application instances were quite helpful.