Now in /proc/sys/fs/file-max there is only 4096, that limit could have
easily been reached. Does changing the value in the file effectively change
the limit system-wide? I changed it and rebooted but it was set right back
to 4096.. I've been out of the Linux loop for a long time (FreeBSD junkie
now) so I don't know how to set that up to permanently change the limit.
Marc: You use Linux, don't you? Have you ever run into this?
Any help is very appreciated, thanks!
-Mitch
> I was just doing some huge operations with PostgreSQL and it all crashed out
> with a "too many files open" message plastered all over the place..
>
> Now in /proc/sys/fs/file-max there is only 4096, that limit could have
> easily been reached. Does changing the value in the file effectively change
> the limit system-wide? I changed it and rebooted but it was set right back
> to 4096..
A reboot would reset values in proc...
For Red Hat Linux 6.2 and up, you would add a line to
/etc/sysctl.conf:
# Max open files:
fs.file-max = 8192
--
Trond Eivind Glomsrød
Red Hat, Inc.
This is really a Linux question, not postgresql, but you knew that...
(I'm keeping hackers on this message, so if it comes up again, the
answer's in the archives with the question)
> Now in /proc/sys/fs/file-max there is only 4096, that limit could have
> easily been reached. Does changing the value in the file effectively change
> the limit system-wide? I changed it and rebooted but it was set right back
> to 4096.. I've been out of the Linux loop for a long time (FreeBSD junkie
> now) so I don't know how to set that up to permanently change the limit.
Almost right. Why'd you reboot? It's a runtime configuration. Proc is not
a file system, it's a pseudo-filesystem interface to kernel internals.
Just do something like:
echo 32768 > /proc/sys/fs/file-max
And you may need to up the number of inodes, too:
echo 65536 > /proc/sys/fs/inode-max
You'll probably want to put these in rc.boot, or rc.local, or something,
to set this at boot time, as well.
Ross
--
Ross J. Reedstrom, Ph.D., <reed...@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005