Обсуждение: Many postmasters...

Поиск
Список
Период
Сортировка

Many postmasters...

От
Jean-Christophe Boggio
Дата:
Hi everyone,

Using Linux RH7.0 with correct gcc and glibc, PG7.03, Apache 1.3.14
and PHP4. We have several unresolved questions :

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

* 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

* 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 ?


Thanks for you attention and help.

--
Jean-Christophe Boggio
cat@thefreecat.org
Independant Consultant and Developer
Delphi, Linux, Oracle, Perl



Re: Many postmasters...

От
Alfred Perlstein
Дата:
* Jean-Christophe Boggio <cat@thefreecat.org> [001207 01:11] wrote:
> Hi everyone,
>
> Using Linux RH7.0 with correct gcc and glibc, PG7.03, Apache 1.3.14
> and PHP4. We have several unresolved questions :
>
> * 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.

I've not seen this.

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

put an & at the end of the command to run it in the background.

or you can reveal what "<many options here>" so we can offer
some real advice.

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

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

Er, I think that's what it's doing, otherwise you wouldn't have this
mess, postgresql startup is pretty cheap, you might want to not
use the pconnect and see what happens.

We removed pconnect from a apache server connecting to a mysql
server and it saved quite a bit of CPU because we only needed
the php connections for a few pages.

--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."