Re: Many postmasters...

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема Re: Many postmasters...
Дата
Msg-id 20001207013316.N16205@fw.wintelcom.net
обсуждение исходный текст
Ответ на Many postmasters...  (Jean-Christophe Boggio <cat@thefreecat.org>)
Список pgsql-general
* 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."

В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Christophe Boggio
Дата:
Сообщение: Many postmasters...
Следующее
От: "Vilson farias"
Дата:
Сообщение: little question