Main Contents

Archives: 'Code'

Quick tuneup

Code | Comments (0)

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

Git on Windows? Yep.

Code | Comments (0)

In my post yesterday, I made a comment about not using git if I was doing full-on Windows development. I heard bits and pieces about using git on Windows, but never really gave them a second thought. However, I found this post yesterday that debunks that theory.

http://kylecordes.com/2008/04/30/git-windows-go/

Sweet! No there’s no excuse.

Ted @ May 15, 2008

Grabbing git patches via gmail

Code | Comments (0)

I’m a rabid gmail user. I pretty much funnel every piece of email I get from my various email addresses into google. Yes, I drank the kool-aide(tm). What’s it you ya? Wanna fight about it?

Anyhoo, I wanted a system where I could use all of the goodness of git-am without having to actually use something other than my beloved gmail. So, using a little python, libgmail and a hacked up “archive.py” script that came with libgmail, I set out to do what I wanted. I am on a Mac, so I do get the added benefit of having all that unix email goodness built right in.

The basic idea is simple. When a patch comes in that I care about, I tag it with “Patches” in gmail. Then I drop to command line and run this script. It basically logs in to gmail, looks for any messages tagged as “Patches” and copies them to my local (and usually unused) unix user’s inbox. It then removes the “Patches” tag and adds the “Old Patches” tag.

(more…)

Ted @ May 8, 2008


Feed