Re: brk() function and performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: brk() function and performance
Date: 2002-07-19 22:33:15
Message-ID: 16230.1027117995@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Sullivan <andrew(at)libertyrms(dot)info> writes:
> On a test machine today, we found simple selects on a table
> with only a couple hundred rows are taking > 300 milliseconds when we
> set the shared buffers to some large number (like enough to allocate
> a Gig of memory), more than 250 ms when running with about 512 Meg of
> shared memory, but under 125 ms when running with a small shared
> buffer setting (say, enough to allocate less than 200 meg -- one test
> we allocated only 4 meg). The main culprit seems to be a memset()
> call that happens over and over to the same address. I've no idea
> why, but there it is.

Hmph. There are some places in the bufmgr that do sequential scans of
the whole buffer array, which might account for a slowdown with huge
numbers of buffers. I do not think any of them are in hotspot paths
however --- at least not in any recent release. This test was on
7.1.something, wasn't it?

Could you recompile with profiling enabled and see where the time is
really going with the large number of buffers?

> The same results are _not_ found in testing with 7.2.1.

This might mean we already fixed the bottleneck, in which case the
question becomes less interesting (at least to me ;-)).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-07-19 23:03:31 Debian stable now includes 7.2.1
Previous Message Stephan Szabo 2002-07-19 22:12:38 Re: Modifying column size