pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedToo many Open files error for postgres
3+ messages / 2 participants
[nested] [flat]
* Too many Open files error for postgres
@ 2016-06-21 13:51 Geo P.C. <pcgeopc@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Geo P.C. @ 2016-06-21 13:51 UTC (permalink / raw)
To: 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/;
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Too many Open files error for postgres
@ 2016-06-21 14:09 Tom Lane <tgl@sss.pgh.pa.us>
parent: Geo P.C. <pcgeopc@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2016-06-21 14:09 UTC (permalink / raw)
To: Geo P.C. <pcgeopc@gmail.com>; +Cc: pgsql-admin
"Geo P.C." <pcgeopc@gmail.com> writes:
> In Ubuntu 14.04 server on a JAVA Application we are getting Too many Open
> files error for postgres.
How many server processes are you trying to use? I suspect you are
hitting the system-wide file table limit not the per-process limit.
Best answer might be to decrease PG's max_files_per_process setting
rather than try to persuade the kernel to increase its limit.
regards, tom lane
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Too many Open files error for postgres
@ 2016-06-22 13:41 Geo P.C. <pcgeopc@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Geo P.C. @ 2016-06-22 13:41 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
Thanks a lot.. We are able to fix the issue with it by reducing
max_files_per_process to 500 from default 1000..
This paramater "Sets the maximum number of simultaneously open files
allowed to each server subprocess". So in postgres it means it reduces the
number of open files limit. If possible can you please refine what it
actually does?
* <http://pcgeo.blogspot.in/>*
On Tue, Jun 21, 2016 at 7:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Geo P.C." <pcgeopc@gmail.com> writes:
> > In Ubuntu 14.04 server on a JAVA Application we are getting Too many Open
> > files error for postgres.
>
> How many server processes are you trying to use? I suspect you are
> hitting the system-wide file table limit not the per-process limit.
> Best answer might be to decrease PG's max_files_per_process setting
> rather than try to persuade the kernel to increase its limit.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2016-06-22 13:41 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 13:51 Too many Open files error for postgres Geo P.C. <pcgeopc@gmail.com>
2016-06-21 14:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-06-22 13:41 ` Geo P.C. <pcgeopc@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox