Re: Bug: Buffer cache is not scan resistant

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavan Deolasee <pavan(at)enterprisedb(dot)com>, Gavin Sherry <swm(at)alcove(dot)com(dot)au>, Luke Lonergan <llonergan(at)greenplum(dot)com>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Doug Rady <drady(at)greenplum(dot)com>, Sherry Moore <sherry(dot)moore(at)sun(dot)com>
Subject: Re: Bug: Buffer cache is not scan resistant
Date: 2007-03-05 21:28:21
Message-ID: 45EC8B75.9040806@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> So the
> problem is not so much the clock sweep overhead as that it's paid in a
> very nonuniform fashion: with N buffers you pay O(N) once every N reads
> and O(1) the rest of the time. This is no doubt slowing things down
> enough to delay that one read, instead of leaving it nicely I/O bound
> all the time. Mark, can you detect "hiccups" in the read rate using
> your setup?
>

I think so, here's the vmstat output for 400MB of shared_buffers during
the scan:

procs -----------memory---------- ---swap-- -----io---- --system--
----cpu----
r b swpd free buff cache si so bi bo in cs us
sy id wa
1 0 764 51772 0 1990688 0 0 120422 2 1546 1755 16
37 46 1
1 0 764 53640 0 1988792 0 0 120422 2 1544 1446 14
40 46 1
1 0 788 54900 0 1987564 0 0 116746 15 1470 3067 15
39 44 2
1 0 788 52800 0 1989552 0 0 119199 20 1488 2216 14
37 47 1
1 0 788 52372 0 1990000 0 0 122880 7 1532 1203 15
39 45 1
1 0 788 54592 0 1987872 0 5 124928 5 1557 1058 17
38 46 0
2 0 788 54052 0 1987836 0 0 118787 0 1500 2469 16
36 47 1
1 0 788 52552 0 1989892 0 0 120419 0 1506 2531 15
36 48 1
1 0 788 53452 0 1989356 0 0 119195 2 1501 1698 15
37 47 1
1 0 788 52680 0 1989796 0 0 120424 2 1521 1610 16
37 47 1

Cheers

Mark

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-05 21:36:39 Re: Bug: Buffer cache is not scan resistant
Previous Message Heikki Linnakangas 2007-03-05 21:03:48 Re: Bug: Buffer cache is not scan resistant