| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Jean-Christophe Boggio <cat(at)thefreecat(dot)org> | 
| Cc: | PGSQL-GENERAL <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: Many postmasters... | 
| Date: | 2000-12-06 05:04:09 | 
| Message-ID: | 6006.976079049@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Jean-Christophe Boggio <cat(at)thefreecat(dot)org> writes:
> * Is it normal that
>   ps aux |grep postgres
>   shows (what we want : processes own by postgres) multiple postgres
>   backends (which seems normal to me) *AND* multiple postmaster (same
>   full cmd line).
>   Sometimes we also have "defunct" postgresses.
Multiple postmasters sounds fishy.  But you haven't looked closely
enough to tell for sure.  I don't trust the ps-status stuff a whole lot,
so I don't trust ps' report of whether a process calls itself a
postmaster or a postgres.  What I do trust is ps' report of process
parent/child relationships.  A true postmaster is always a child of init
(process 1); a true backend is always a child of some true postmaster.
If you see more children of process 1 than you thought you should have,
then that needs looking into.
A <defunct> postmaster or postgres is an indication of trouble, also,
since either init or the parent postmaster (respectively) should have
reaped the dead process immediately.  If a zombie process survives more
than a few milliseconds then something is wrong with its parent.  Again,
the parent-process link shown by ps is critical information.
> * we start postgres with a /etc/rc.d/init.d script that launches
>   pg_ctl -w <many options here> start
>   When invoked from the shell, this command never returns to the shell
>   by itself, we have to press <enter>. This behaviour prevents the
>   script for terminating properly. Is there a way around this ?
That seems broken.  I think there was an old version of pg_ctl that
didn't work properly unless -S was one of the switches passed to the
postmaster --- is that what's biting you?
> * every backend created by an Apache session opens many files (in our
>   case, about 80 including the indexes) and many backends will finally
>   generate an "Too many files open" message. We first increased the
>   /proc/sys/fs/file-max to 8192 but that's a lot !
No it's not. Increase file-max or decrease your max number of backends.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Soma Interesting | 2000-12-06 05:34:19 | Re: Overhead of tables. | 
| Previous Message | Tom Lane | 2000-12-06 04:48:37 | Re: Overhead of tables. |