Re: Many postmasters...

From: GH <grasshacker(at)over-yonder(dot)net>
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 03:38:21
Message-ID: 20001205213821.A81189@over-yonder.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 06, 2000 at 02:06:01AM +0100, some SMTP stream spewed forth:
> Hi everyone,

Hi

>
> Using Linux RH7.0 with correct gcc and glibc, PG7.03, Apache 1.3.14

> and PHP4. We have several unresolved questions :
Ah, but do not we all? ;-)

>
> * Is it normal that
Er, it seems so...not sure about the "defunct" business.

> 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.
>
> * 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 ?
> Not tried echo | pg_ctl .... yet
I would need to see the code, but perhaps someone else would not. (?)

>
> * 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 !
>
> The apache/php server always uses the same connect parameters for
> every page but it seems php's pg_pconnect() behaves just like
> pg_connect. Shouldn't we have apache hold a few backends connected ?

pg_pconnect creates a persistent connection *for that Apache process*.
Id est: 10 backends, 10 persistent connections to 10 Postgres backends.
Yep, I hate the situation too, but tcl under AOLServer or Java are not
options to me, perhaps they are to you. (The overhead for non-persistent
connections is not *that* bad, but it is (to me) noticeable.)
Connection pooling would (somewhat) "fix" the situation, but...blah.
Unless you are in a situation where you can set MaxClients equal to
the max(backends) then I would just use regular connections (as I have
been "forced" to do in my current situation).

Apache does not (and can not?) do connection pooling in itself, I
believe there may be modules that do so, but I do not use them.

>
>
> Thanks for you attention and help.
Hey, that's why we are here, eh?

I hope that I have been (at least somewhat) helpful.

"'Aaaaaaarggggghhhhhh!' went Ford Prefect...", The Hitchhiker's Guide to
the Galaxy, Douglas Adams

gh

>
> --
> Jean-Christophe Boggio
> cat(at)thefreecat(dot)org
> Independant Consultant and Developer
> Delphi, Linux, Oracle, Perl
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ashley 2000-12-06 04:16:07 Clarification
Previous Message Alain Toussaint 2000-12-06 03:36:22 Re: MacIntosh