Re: postgresql 7.1 file descriptor

From: Scott Marlowe <scott(dot)marlowe(at)ihs(dot)com>
To: jade <jade(at)vanzoest(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgresql 7.1 file descriptor
Date: 2002-05-08 17:21:49
Message-ID: Pine.LNX.4.33.0205081112080.20291-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

On Tue, 7 May 2002, jade wrote:

>
> Hi,
>
>
> I am running postgresql - 7.1 on Redhat 2.2.16-22 kernel.
> Sometimes this the system becomes totally unusable with
> "VFS: file-max limit 4096 reached" error? The system is setup to have
> 4096 file descriptor as default. I was wondering how many file descriptor
> does postgres open per backend process?

I think it depends on what those backends are doing. I just ran a pgbench
-c 100 -t 10 on my machine, and went from "2253 712 8192" in
/proc/sys/fs/file-nr to "5316 3825 8192" in the same file.

According to /usr/src/linux-2.4/Documentation/sysctl/fs.txt on my machine,
the first number is the number of file handles allocated, the second is
the number in use, and the third is the max.

So, running 100 simos on my personal workstation used about 3000 file
handles allocated, with about the same number showing use.

To easiest way to change these settings is through the use of sysctl. If
your machine doesn't have sysctl installed, find it and install it, it's a
VERY easy way to change system / kernel settings.

After install, look at man sysctl for more info.

East explanation, sysctl -a shows all settings, sysctl -p process and sets
all settings found in /etc/sysctl.conf

On production servers, the number for file-max is often set to 32768 or
higher (on our big boxes we have it set to 65536 and often see usage of
well over 20000 under load.)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Pimlott 2002-05-08 17:35:12 Re: non-standard escapes in string literals
Previous Message Tom Lane 2002-05-08 17:00:07 Bad side-effect from making EXPLAIN return a select result

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Atkins 2002-05-08 17:53:08 Re: Performance issues with compaq server
Previous Message Masaru Sugawara 2002-05-08 16:51:59 Re: blanking out repeated columns in rows