By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,775 Members | 1,740 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,775 IT Pros & Developers. It's quick & easy.

postmaster processes

P: n/a
-----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+PVWFjjmObUhVvhpmcS 6riJ+ktKSrpbtx
/iGGmTavdI2cbNhZTVqD3Jtnmhfy6lmRsf7pB0Hd75UzMCkSUz4 Bc/97D1YnPx4O
/wa0YPwx2xs3tmhaWRt99yU3YUqNKUmrwuNkNXKj+4vEyN1u3CD Ommvb+fitl9bi
Sxhe2ZHi8wo=
=lLaV
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Andy Harrison <ah**@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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #2

P: n/a
-----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
fkfPLpHRd9ufHeKOUVyUfp2C0rwFhefLPx5MeXz1hTyHZzHzlx nhwKMVOe4Zlni3
L6S4BmOP1V4=
=bE+l
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.