Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[HACKERS] Linux / PostgreSQL question

0 views
Skip to first unread message

Mitch Vincent

unread,
Sep 14, 2000, 3:00:00 AM9/14/00
to
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.. 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

Trond Eivind Glomsrød

unread,
Sep 14, 2000, 3:00:00 AM9/14/00
to
"Mitch Vincent" <mi...@venux.net> writes:

> 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.

Ross J. Reedstrom

unread,
Sep 14, 2000, 3:00:00 AM9/14/00
to
On Wed, Sep 13, 2000 at 01:04:32PM -0700, Mitch Vincent wrote:
> 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..
>

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

0 new messages