Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] ARC Memory Usage analysis

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)MIT(dot)EDU>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] ARC Memory Usage analysis
Date: 2004-10-25 21:53:25
Message-ID: 790.1098741205@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patchespgsql-performance
Greg Stark <gsstark(at)MIT(dot)EDU> writes:
> So I would suggest using something like 100us as the threshold for
> determining whether a buffer fetch came from cache.

I see no reason to hardwire such a number.  On any hardware, the
distribution is going to be double-humped, and it will be pretty easy to
determine a cutoff after minimal accumulation of data.  The real question
is whether we can afford a pair of gettimeofday() calls per read().
This isn't a big issue if the read actually results in I/O, but if it
doesn't, the percentage overhead could be significant.

If we assume that the effective_cache_size value isn't changing very
fast, maybe it would be good enough to instrument only every N'th read
(I'm imagining N on the order of 100) for this purpose.  Or maybe we
need only instrument reads that are of blocks that are close to where
the ARC algorithm thinks the cache edge is.

One small problem is that the time measurement gives you only a lower
bound on the time the read() actually took.  In a heavily loaded system
you might not get the CPU back for long enough to fool you about whether
the block came from cache or not.

Another issue is what we do with the effective_cache_size value once we
have a number we trust.  We can't readily change the size of the ARC
lists on the fly.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Kenneth MarshallDate: 2004-10-25 22:48:30
Subject: Re: [PATCHES] ARC Memory Usage analysis
Previous:From: Greg StarkDate: 2004-10-25 21:30:52
Subject: Re: [PATCHES] ARC Memory Usage analysis

pgsql-hackers by date

Next:From: CSNDate: 2004-10-25 21:56:34
Subject: Re: copy - fields enclosed by, ignore x lines
Previous:From: CSNDate: 2004-10-25 21:45:57
Subject: copy - fields enclosed by, ignore x lines

pgsql-patches by date

Next:From: Andrew DunstanDate: 2004-10-25 22:46:57
Subject: Re: rmtree() failure on Windows
Previous:From: Greg StarkDate: 2004-10-25 21:30:52
Subject: Re: [PATCHES] ARC Memory Usage analysis

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group