Quick tuneup
I run both my redmine install and my Askerisk box on the same VPS. It’s the 256 meg one from slicehost. While this should be more than enough server for the couple of little things I do, I was more than underwhelmed with the performance from my redmine install. I decided to take a few minutes this morning and squeeze out some performance.
After these couple of changes, I noticed a big improvement on the speed at which pages were coming back. +1 for reading. It really is fun-da-mental.
mod_rails
My redmine install is using the wonderfully simple mod_rails for apache2. It was a dream to setup and works great… however I needed to tweak some default settings in order for it not to take 3-4 seconds per page view. I got these from the mod_rails documentation (which is very good, BTW).
<VirtualHost *> [...] RailsMaxPoolSize 2 #defaults to 20 RailsPoolIdleTime 600 #default to 120 </VirtualHost>
Basically, because of the nature of the app, it’s both not high traffic and needed a little more time before the processes were removed. Redmine is one of those apps you hang out on for a little while and take time to write a decent ticket or set some complicated permissions. Having the processes die in 120 seconds was frustrating, because it always seemed like you were waiting for them to spin back up.
Also, having 20 rails processes running would require a lot of swap space. And given that myself and maybe one other person will ever be on it at one time, having more than 2 isn’t really necessary. The lack of swapping makes it feel snappier.
Logging
One other tweak I always forget about when I push a site into production is to change the default logging. By default, “production” rails logs as info, when really error is the better way to go. It saves space and requires less disk I/O per page view.
Just open up config/environments/production.rd and add:
config.log_level = :error
to the bottom of the file. Restart the app (touch tmp/restart.txt for mod_rails) and you’re good.
Ted @ May 16, 2008