In REE, and MRI 1.9+, ruby's garbage collector can be tuned:
- http://www.rubyenterpriseedition.com/documentation.html#_garbage_collector_performance_tuning
- http://smartic.us/2010/10/27/tune-your-ruby-enterprise-edition-garbage-collection-settings-to-run-tests-faster/
- http://blog.evanweaver.com/articles/2009/04/09/ruby-gc-tuning/
But none of these articles say where to put this configuration. I imagine that if it's in the environment, ruby will pick it up when it starts -- however, there's no way to check this as far as I can tell. The settings don't show up in any runtime constants that I can find.
So, where do I put this configuration, and how can I double-check that it's being used?
These settings are environment variables, so you would just need to set them in the parent process of the
rubyprocess itself. Many people recommend creating a simple shell script for this purpose, perhaps calling it/usr/local/bin/ruby-custom:The first few lines set whichever custom variables you want, and the last line invokes
rubyitself, passing it whatever arguments this script was initially given.You will next need to mark this script as executable (
chmod a+x /usr/local/bin/ruby-custom) and then configure Passenger to use it as therubyexecutable, by adding this to your Apache .conf file: