zdennis wrote: > You can actually test this in a unit test. =) > There is also a method on ActiveRecord::Base called 'active_connections' > There is another method on ActiveRecord::Base called > 'threaded_connections' which returns true or false (by default true). I [much snippage above] Well, unit test or not, the evidence is here: # ps aux | grep postgres | grep idle | grep -v grep | wc -l 22 template1=# select count(*) from pg_stat_activity where current_query = '<IDLE>' and query_start < NOW() - '2 hours'::INTERVAL; count ------- 18 The good news is, some of the processes DO seem to go away on their own. The bad news is, some stay around for some time: template1=# select count(*) from pg_stat_activity where current_query = '<IDLE>' and query_start < NOW() - '20 hours'::INTERVAL; count ------- 2 As well, I haven't yet actually gotten the "too many connections" error from PostgreSQL, so that is somewhat encouraging. Furthermore, we should bear in mind that some of these connections are from the companion Rails site that works with the game (shared DB). I'm not sure how to distinguish Rails connections from game connections. I'm using FastCGI, and, as far as I know, that keeps processes alive. If you ever find time, maybe we can work together on the problem via IRC? I'm on FreeNode often with the nick Pistos. Pistos -- Posted via http://www.ruby-forum.com/.