Re: Monitoring number of backends

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Monitoring number of backends
Date: 2013-10-23 02:11:17
Message-ID: 20131023021117.GJ2706@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* John R Pierce (pierce(at)hogranch(dot)com) wrote:
> On 10/22/2013 1:13 PM, andy wrote:
> >No, actually, I don't think my connect overhead is huge. My
> >apache and postgres are on the same box, and it connects using
> >unix socket. Perhaps if my apache on db were on different boxes it
> >would be a problem.
>
> each postgres connection, if you're not using a pool, requires a
> fork() of the postgres process. fork is inherently an expensive
> process, especially for a moderately large and fairly complex piece
> of software like postgresql.

As Tom points out, it's really PG that makes the new connections slow;
fork(), while it can be slow on some platforms, really is small potatos
compared to PG opening a database, populating caches, etc.

Thanks,

Stephen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2013-10-23 02:37:45 Re: ISO8859_1 vs UTF-8 Performance?
Previous Message BladeOfLight16 2013-10-23 02:09:06 Re: Bug? Function with side effects not evaluated in CTE