"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