Too many Open files error for postgres

From: "Geo P(dot)C(dot)" <pcgeopc(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Too many Open files error for postgres
Date: 2016-06-21 13:51:40
Message-ID: CAKtc8vXh7NvP_qWj8EqqorPY97bvxSaX3h5u7a9PptRFHW5x7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

In Ubuntu 14.04 server on a JAVA Application we are getting Too many Open
files error for postgres.

We set the following in /etc/security/limits.conf

* soft nofile 16384
* hard nofile 16384
root soft nofile 16384
root hard nofile 16384
postgres soft nofile 16384
postgres hard nofile 16384

Also set the following in /etc/sysctl.conf

kern.maxfiles=20480
kern.maxfilesperproc=18000

Also please see the following results while running as postgres user:

-> ulimit -Hn
16384

-> ulimit -Sn
16384

-> cat /proc/sys/fs/file-max
100268

After restarting the server and checking the ulimit for postgres its 16384
But while checking the limit for opened files under postgres process its
still 1024 and 4096

# cat /proc/1072/limits

Max open files 1024 4096 files

When we restart postgres services it got changed to

#cat /proc/1759/limits
Max open files 16384 16384 files

But it seems its snot affected because still we are getting Too many Open
files error. So can anyone please guide me.

Thanks
Geo <http://pcgeo.blogspot.in/>

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2016-06-21 14:09:40 Re: Too many Open files error for postgres
Previous Message Alex Ignatov 2016-06-21 09:56:41 Re: reuse tablespace from crashed PSQL instance