samedi 27 juin 2015

How to close inactive connections in Postgres

Postgres 9.1 sever is running under Debian. It is accessed by Mono MVC4 web applications using ngpsql, Apache and mod_mono. It is also accessed by pg_dump in same computer every night and from 5432 port from internet. Connections were cleared at June 20. pgAdmin statuc window shows lot of idle connections starting from this day. (see image below).

After some time number of connections goes to 100 and server stops to accept connections. Connections needs to be manually killed in pgAdmin. Only after that server start accepting connections again.

It is interesting that start times of some of those connections are exactly the same as shown in image. How to fix or diagnose the issue ? I tried /etc/init.d/apache2 restart . This closed 25 and 27 June connections but 20 June connections are still open.

How to close idle connections automatically or find the reason of open connections ? Maybe there is some postgres or Debian setting which closes idle connections automatically ?

open connections

Using

"PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit"

Aucun commentaire:

Enregistrer un commentaire