On Fri, 20 Feb 2004, Gellert, Andre wrote:
> I have done this before, but when i remember right, the only effect is,
> that every second dozens of postmaster processes started and closed, because
> the connection is thrown away. This helps for now, as i can see on "low
> traffic" , but when I tried first, we had heavy load just by starting this
> large number of processes. There are 5-10 php skripts running per second, in
> peeks maybe even twice or more.
> This is a problem for the system , when for every process postmaster must be
> started, or am I wrong ?
Actually, most of my scripts spend a LOT more time running PHP and queries
than they do initiating connections. If you get a chance, profile your
code (microtime() is useful for this) to see where the time is being
spent. If you see the pg_connect time climbing non-linearly with load,
then you may need to use pg_pconnect. If the time is climbing linearly
with load and is only a tiny fraction of the amount of time it takes to
run the script, then don't worry about it.