Re: First set of OSDL Shared Mem scalability results,

From: "J(dot) Andrew Rogers" <jrogers(at)neopolitan(dot)com>
To: josh(at)agliodbs(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: First set of OSDL Shared Mem scalability results,
Date: 2004-10-08 22:13:00
Message-ID: 1097273580.25588.18.camel@vulture.corp.neopolitan.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

I have an idea that makes some assumptions about internals that I think
are correct.

When you have a huge number of buffers in a list that has to be
traversed to look for things in cache, e.g. 100k, you will generate an
almost equivalent number of cache line misses on the processor to jump
through all those buffers. As I understand it (and I haven't looked so
I could be wrong), the buffer cache is searched by traversing it
sequentially. OTOH, it seems reasonable to me that the OS disk cache
may actually be using a tree structure that would generate vastly fewer
cache misses by comparison to find a buffer. This could mean a
substantial linear search cost as a function of the number of buffers,
big enough to rise above the noise floor when you have hundreds of
thousands of buffers.

Cache misses start to really add up when a code path generates many,
many thousands of them, and differences in the access path between the
buffer cache and disk cache would be reflected when you have that many
buffers. I've seen these types of unexpected performance anomalies
before that got traced back to code patterns and cache efficiency and
gotten integer factors improvements by making some seemingly irrelevant
code changes.

So I guess my question would be 1) are my assumptions about the
internals correct, and 2) if they are, is there a way to optimize
searching the buffer cache so that a search doesn't iterate over a
really long buffer list that is bottlenecked on cache line replacement.

My random thought of the day,

j. andrew rogers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-10-08 22:21:28 Re: First set of OSDL Shared Mem scalability results, some wierdness ...
Previous Message Reini Urban 2004-10-08 21:53:48 Re: more dirmod CYGWIN (was: APR 1.0 released)

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-10-08 22:21:28 Re: First set of OSDL Shared Mem scalability results, some wierdness ...
Previous Message Josh Berkus 2004-10-08 21:43:16 First set of OSDL Shared Mem scalability results, some wierdness ...