Re: [HACKERS] file descriptors leak?

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gene Sokolov <hook(at)aktrad(dot)ru>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] file descriptors leak?
Date: 1999-11-02 18:13:42
Message-ID: Pine.GSO.3.96.SK.991102211017.20082M-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2 Nov 1999, Tom Lane wrote:

> Date: Tue, 02 Nov 1999 10:18:15 -0500
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> To: Gene Sokolov <hook(at)aktrad(dot)ru>
> Cc: pgsql-hackers(at)postgreSQL(dot)org
> Subject: Re: [HACKERS] file descriptors leak?
>
> "Gene Sokolov" <hook(at)aktrad(dot)ru> writes:
> > We disconnected all clients and the number of descriptors dropped from 800
> > to about 200, which is reasonable. We currently have 3 connections and ~300
> > used descriptors. The "lsof -u postgres" is attached.
>
> Hmm, I see a postmaster with 8 open files and one backend with 34.
> Doesn't look out of the ordinary to me.

I see 617 open files (using lsof| grep post | wc).
This is a Linux 2.0.37, postgres 6.5.3, 1 postamster and
10 backends. I already complained about this and would glad
to understand now is it ok or postgres just wast fd ?

>
> > It seems ok except for a large number of open /dev/null.
>
> I see /dev/null at the stdin/stdout/stderr positions, which I suppose
> means that you started the postmaster with -S instead of directing its
> output to a logfile.

In my case most files just /dev/sda.....

>
> It is true that on a system that'll let individual processes have as
> many open file descriptors as they want, Postgres can soak up a lot.
> Over time I'd expect each backend to acquire an FD for practically
> every file in the database directory (including system tables and
> indexes). So in a large installation you could be looking at thousands
> of open files. But the situation you're describing doesn't seem like
> it should reach those kinds of numbers.
>
> The number of open files per backend can be constrained by fd.c, but
> AFAIK there isn't any way to set a manually-specified upper limit; it's
> all automatic. Perhaps there should be a configuration option to add
> a limit.
>
> regards, tom lane
>
> ************
>

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-11-02 18:21:35 Re: [GENERAL] users in Postgresql
Previous Message Aaron J. Seigo 1999-11-02 18:13:40 Re: [HACKERS] Get OID of just inserted record