BUG #14453: Growing file descriptors on IDLE connections

Started by Akshay Ballarpureover 9 years ago2 messagesbugs
Jump to latest
#1Akshay Ballarpure
akshay.ballarpure@tcs.com

The following bug has been logged on the website:

Bug reference: 14453
Logged by: Akshay B
Email address: akshay.ballarpure@tcs.com
PostgreSQL version: Unsupported/Unknown
Operating system: RHEL
Description:

Hi,
Is there any way to clean up idle connections which are consuming a large
number of file descriptors ? Does it have any impact on psql server
performance ?

[root@ms-esmon cloud-user]# ps -eaf | grep postgres
postgres 2809 1 0 Dec06 ? 00:00:04 /usr/bin/postmaster -p 5432
-D /var/ericsson/esm-data/postgresql-data
postgres 2811 2809 0 Dec06 ? 00:00:09 postgres: logger process

postgres 2813 2809 0 Dec06 ? 00:01:10 postgres: writer process

postgres 2814 2809 0 Dec06 ? 00:00:48 postgres: wal writer process

postgres 2815 2809 0 Dec06 ? 00:00:15 postgres: autovacuum
launcher process
postgres 2816 2809 0 Dec06 ? 00:00:17 postgres: stats collector
process
postgres 16934 2809 0 10:35 ? 00:00:02 postgres: rhqadmin rhq
127.0.0.1(55676) idle
postgres 17315 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55709) idle
postgres 17318 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55710) idle
postgres 17338 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55716) idle
postgres 17339 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55717) idle
postgres 17340 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55718) idle
postgres 17341 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55719) idle
postgres 17527 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55720) idle
postgres 17528 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55721) idle
postgres 17530 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55722) idle
postgres 17534 2809 0 10:37 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55723) idle
postgres 18095 2809 0 10:44 ? 00:00:00 postgres: rhqadmin rhq
127.0.0.1(55779) idle
postgres 18426 2809 0 10:47 ? 00:00:00 postgres: rhqadmin rhq
[local] idle
postgres 19452 2809 0 10:52 ? 00:00:00 postgres: rhqadmin rhq
[local] idle

[root@ms-esmon cloud-user]# lsof -p 2813 | wc -l
51
[root@ms-esmon cloud-user]# lsof -p 2814 | wc -l
44
[root@ms-esmon cloud-user]# lsof -p 2815 | wc -l
43
[root@ms-esmon cloud-user]# lsof -p 2816 | wc -l
42
[root@ms-esmon cloud-user]# lsof -p 2809 | wc -l
47
[root@ms-esmon cloud-user]# lsof -p 2811 | wc -l
43

below are the counts on idle connections PID
[root@ms-esmon cloud-user]# lsof -p 16934 | wc -l
220
[root@ms-esmon cloud-user]# lsof -p 17315 | wc -l
80
[root@ms-esmon cloud-user]# lsof -p 17318 | wc -l
79
[root@ms-esmon cloud-user]# lsof -p 17338 | wc -l
140
[root@ms-esmon cloud-user]# lsof -p 17339 | wc -l
150
[root@ms-esmon cloud-user]# lsof -p 17340 | wc -l
148

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Stephen Frost
sfrost@snowman.net
In reply to: Akshay Ballarpure (#1)
Re: BUG #14453: Growing file descriptors on IDLE connections

Greetings,

* akshay.ballarpure@tcs.com (akshay.ballarpure@tcs.com) wrote:

The following bug has been logged on the website:

THis is not a bug.

Is there any way to clean up idle connections which are consuming a large
number of file descriptors ? Does it have any impact on psql server
performance ?

Having lots of idle connections around can impact performance in some
instances. PostrgeSQL intentionally caches the file descriptors of open
files to avoid the overhead of opening them again but that generally
isn't a performance issue.

I would suggest you look into a connection pooler (eg: pgbouncer) to
avoid having lots of idle connections to the database.

Thanks!

Stephen