Re: Linux max on shared buffers?

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, GB Clark <postgres(at)vsservices(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, <glenebob(at)nwlink(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Linux max on shared buffers?
Date: 2002-07-23 02:18:43
Message-ID: Pine.NEB.4.44.0207231114130.497-100000@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 22 Jul 2002, Jan Wieck wrote:

> I have some more wrinkles to iron out as well. We can hold blocks of
> hundreds of different files in our buffer cache without the need to keep
> an open file descriptor...

As you can with mmap as well. The mapping remains after the file
descriptor is closed.

> In a complicated schema where you cannot keep all files open anymore...

You can keep just as many files open when you use mmap as you can with
the current scheme. The limit is the number of file descriptors you have
available.

> ...access to your kernel buffered blocks requires open(), mmap(), munmap()
> and close() then? Four system calls to get access to a cached block
> where we get away with a TAS today?

If you leave the block mapped, you do not need to do any of that. Your
limit on the number of mapped blocks is basically just the limit on
address space. So it would not be unreasonable to have your "cache" of
mappings be, say, a gigabyte in size. On systems which normally allocate
less shared memory than that, this would mean you would actually make
fewer syscalls than you would with shared memory.

cjs
--
Curt Sampson <cjs(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-07-23 02:43:37 Stats Collector
Previous Message Darren Ferguson 2002-07-23 02:04:54 Re: Access Two Databases