Scott Marlowe wrote:
Yeah, I found these three facets of the OP's system a bit disconcerting:
QUOTE ---
This is for a web application which uses a new connection for each CGI
request.
The server doesn't have a particularly high disk bandwidth and this
mysterious activity had been the bottleneck for some time.
The system is a little unusual as one of the databases has tens of
thousands of tables.
ENDQUOTE ---
Any two of those choices could cause some issues, but all three together
are pretty much a death knell for performance, whether or not the
global/pgstat file is being written or not.
See my previous message for some background about the application and an
example URL. When PostgreSQL is running smoothly, it is not the
bottleneck in the system: all it has to do is read maybe 100k from the
disk (or more likely the cache), do some in-memory sorts and joins, and
pass it to the rest of the application.
As far as I can see it is only because some parts of PostgreSQL have
poor O(num tables) performance that things are slowing down.
--Phil.
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq