ActiveRecord opening multiple database connections

Does anyone know why ActiveRecord is opening multiple database
connections per process?

I’ve got an app running under Lighty/FCGI with 5 server dispatch
processes. It starts out with 5 database connections, but over time
(several days), the number of database connection processes increase (to
over 25). Using lsof I can see that all the database processes (Postgres
8.1.4 BTW) are still attached to the Rails dispatch processes. Who knows
if Rails still knows they’re there though.

I have no idea why – I’m not doing anything fancy (that I know of) like
opening multiple databases or using class-specific connections. Any
ideas?

It’s no big deal I guess; I can keep increasing Postgres’ max # of
connections, but it is strange, and they are taking up memory.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs