Multiple Postgres idle connections

Hi All,

I implemented a standalone ruby program that helps to my RoR app to
execute processes in background, the web app adds a request to the
ruby program, then this spawns a thread and the web app monitors the
status until the process is completed. All things work perfect and
nice. But, I noted that I’m getting multiple DB idle connections, I
think (not sure) this behavior is OK because the connections are
reused without problems and the idle connections take a while to
disappear (~1 hour or so). I noted that RoR and Passenger have same
idle connection behavior, the Passenger seems to kill the idle DB
connections every an amount of time (~20 min or so). So, I’d like to
configure the ruby program to kill the idle DB connections every an
amount of time. Question: is there some way to configure the “idle
timeout” via a configuration file (database.yml) for Postgres?

[ruby v1.8.7-p334, postgres v8.2.15, rails v3.0.7]


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