Re: Linux max on shared buffers?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, 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-24 02:37:39
Message-ID: 200207240237.g6O2bd420045@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Is it significant that you these shared libraries remain mapped for the
duration of the process, while blocks are moved in and out?

---------------------------------------------------------------------------

Curt Sampson wrote:
> On Tue, 23 Jul 2002, Jan Wieck wrote:
>
> > No resource limit on that? So my 200 backends all map some random
> > 16,000 blocks from 400 files and the kernel jiggles with it like
> > it's never did anything else?
>
> Do you know how much of your process is already mmaped in exactly this
> way? If you take a look at the source code for ld.so, you'll likely find
> that all of the shared libraries your executable is using are mapped
> in to your process space with mmap. And in fact, it's all mmap under
> the hood as well; the kernel is effectively internal calls to mmap to
> map the executable and ld.so into memory in the first place. On BSD
> systems, at least, but probably others, all of the shared memory is just
> an anonymous (i.e., using swap space as the backing store) bunch of
> mmapped pages.
>
> So in theory, having several hundred processes each with a gigabyte
> or two of mmaped 8K blocks is not going to be a problem. However,
> I've not tested this in practice (though I will do so one day) so
> that's not to say it won't fail on certain OSes. In that case you'd
> want to map much smaller amounts, and live with the extra syscall
> overhead. But even so, it would still be far more efficient than
> copying blocks into and out of 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Curt Sampson 2002-07-24 02:46:41 Re: Linux max on shared buffers?
Previous Message Curt Sampson 2002-07-24 02:11:25 Re: Problem between inheritance and references