Thread: postmaster processes

postmaster processes

From
Andy Harrison
Date:
-----BEGIN PGP SIGNED MESSAGE-----

Could anyone explain about the max_connections in postgres?

We ran into the connection limit on one of our production servers.  One reason
is that we have more apps that use postgres running on it (RT3 and Webcollab
were added not long ago).  Webcollab, for instance, seems to keep 7 postmaster
processes all to itself.  Is this normal?  Does postgres work similarly to
how apache handles spawning spare servers?

I notice also on my test server, that 7 postmaster processes for webcollab are
running, even though I'm the only one who has used it, and not all that
heavily, and they haven't been touched for two days.


# ps -U pgsql -ax -o pid,ppid,start,time,command
  PID  PPID STARTED      TIME COMMAND
 4876     1 18Aug03   0:08.35 /usr/local/bin/postmaster (postgres)
 4880  4876 18Aug03   0:00.04 postmaster: stats buffer process    (postgres)
 4881  4880 18Aug03   0:00.18 postmaster: stats collector process    (postgres)
24053  4876 Tue11AM   0:00.09 postmaster: webcollab webcollab [local] idle
(postgres)
24054  4876 Tue11AM   0:00.06 postmaster: rt3 rt3 127.0.0.1 idle (postgres)
24060  4876 Tue11AM   0:00.05 postmaster: rt3 rt3 127.0.0.1 idle (postgres)
24062  4876 Tue11AM   0:00.09 postmaster: webcollab webcollab [local] idle
(postgres)
24230  4876 Tue02PM   0:00.05 postmaster: webcollab webcollab [local] idle
(postgres)
24231  4876 Tue02PM   0:00.53 postmaster: webcollab webcollab [local] idle
(postgres)
24236  4876 Tue02PM   0:00.44 postmaster: webcollab webcollab [local] idle
(postgres)
24237  4876 Tue02PM   0:01.35 postmaster: webcollab webcollab [local] idle
(postgres)
24238  4876 Tue02PM   0:02.45 postmaster: webcollab webcollab [local] idle
(postgres)


Could anyone enlighten me?  I already tried digging through various docs and
list archives, but didn't turn up much.  If you could point me to some specific
reading that would be appreciated as well.  Thanx!



~~
Andy Harrison
(full headers for details)


-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQCVAwUBP1dTU1PEkLgodAWVAQEBsQP+PVWFjjmObUhVvhpmcS6riJ+ktKSrpbtx
/iGGmTavdI2cbNhZTVqD3Jtnmhfy6lmRsf7pB0Hd75UzMCkSUz4Bc/97D1YnPx4O
/wa0YPwx2xs3tmhaWRt99yU3YUqNKUmrwuNkNXKj+4vEyN1u3CDOmmvb+fitl9bi
Sxhe2ZHi8wo=
=lLaV
-----END PGP SIGNATURE-----

Re: postmaster processes

From
Doug McNaught
Date:
Andy Harrison <ah11@mlz.us> writes:

> Could anyone explain about the max_connections in postgres?
>
> We ran into the connection limit on one of our production servers.
> One reason is that we have more apps that use postgres running on it
> (RT3 and Webcollab were added not long ago).  Webcollab, for
> instance, seems to keep 7 postmaster processes all to itself.  Is
> this normal?  Does postgres work similarly to how apache handles
> spawning spare servers?

No, it doesn't.  If a PG backend is hanging around, it means an
application is keeping it open.  Most likely the app has a connection
pooling library that hangs onto connections rather than incur the
overhead of creating new ones for every request.

> I notice also on my test server, that 7 postmaster processes for
> webcollab are running, even though I'm the only one who has used it,
> and not all that heavily, and they haven't been touched for two
> days.

See above.  The app is in control--see if it has settings to control
the connection pool.

-Doug

Re: postmaster processes

From
Andy Harrison
Date:
-----BEGIN PGP SIGNED MESSAGE-----


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On 04-Sep-2003, Doug McNaught wrote message "Re: [GENERAL] postmaster processes"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> No, it doesn't.  If a PG backend is hanging around, it means an
> application is keeping it open.  Most likely the app has a connection
> pooling library that hangs onto connections rather than incur the
> overhead of creating new ones for every request.


Thanx!  This led me in the right direction, the php.ini defaults:

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On
; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
pgsql.auto_reset_persistent = Off
; Maximum number of persistent links.  -1 means no limit.
pgsql.max_persistent = -1
; Maximum number of links (persistent+non persistent).  -1 means no limit.
pgsql.max_links = -1


~~
Andy Harrison
(full headers for details)


-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQCVAwUBP1d9lVPEkLgodAWVAQFCLQP/fkUxdh+c6R4NKz3hWvGSBjL7pp+Dsuo/
5cq94c3hgqGdOKAo5R90JAjSpwt5xWovXbhDeYw/MM8UM0Ku6mTbOC2YEjGEkz5S
fkfPLpHRd9ufHeKOUVyUfp2C0rwFhefLPx5MeXz1hTyHZzHzlxnhwKMVOe4Zlni3
L6S4BmOP1V4=
=bE+l
-----END PGP SIGNATURE-----