Re: Question on hardware & server capacity - Mailing list pgsql-performance

From Tom Lane
Subject Re: Question on hardware & server capacity
Date
Msg-id 3255.1041537454@sss.pgh.pa.us
Whole thread Raw
In response to Question on hardware & server capacity  ("Steve Wolfe" <nw@codon.com>)
List pgsql-performance
"Steve Wolfe" <nw@codon.com> writes:
> I logged some queries, and found that in an average second, the machine
> forks off 10 new backends, and responds to 50 selects and 3 updates.

So an average backend only processes ~ 5 queries before exiting?

>   My feelings are that the machine is being swamped by both the number of
> context switches and the I/O, most likely the memory bandwidth.

I think you're getting killed by the lack of connection pooling.
Launching a new backend is moderately expensive: there's not just the
OS-level fork overhead, but significant cost to fill the catalog caches
to useful levels, etc.

7.3 has reduced some of those startup costs a little, so if you're still
on 7.2 then an update might help.  But I'd strongly recommend getting
connection re-use in place before you go off and buy hardware.

            regards, tom lane

pgsql-performance by date:

Previous
From: Hilmar Lapp
Date:
Subject: join over 12 tables takes 3 secs to plan
Next
From: Tom Lane
Date:
Subject: Re: join over 12 tables takes 3 secs to plan