pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Alan Stange <stange@rentec.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Luke Lonergan <llonergan@greenplum.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Joshua Marsh <icub3d@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Hardware/OS recommendations for large databases (
Date: Tue, 22 Nov 2005 23:53:16 -0500 (EST)
Message-ID: <200511230453.jAN4rGs24421@candle.pha.pa.us> (raw)
In-Reply-To: <4383E89C.8040200@rentec.com>

Alan Stange wrote:
> Bruce Momjian wrote:
> > Right now the file system will do read-ahead for a heap scan (but not an
> > index scan), but even then, there is time required to get that kernel
> > block into the PostgreSQL shared buffers, backing up Luke's observation
> > of heavy memcpy() usage.
> >
> > So what are our options?  mmap()?  I have no idea.  Seems larger page
> > size does help.

> For sequential scans, you do have a background reader.  It's the 
> kernel.  As long as you don't issue a seek() between read() calls, the 

I guess you missed my text of "Right now the file system will do
read-ahead", meaning the kernel.

> I don't think the memcpy of data from the kernel to userspace is that 
> big of an issue right now.  dd and all the high end network interfaces 
> manage OK doing it, so I'd expect postgresql to do all right with it now 
> yet too.   Direct IO will avoid that memcpy, but then you also don't get 
> any caching of the files in memory.  I'd be more concerned about any 
> memcpy calls or general data management within postgresql.    Does 
> postgresql use the platform specific memcpy() in libc?  Some care might 
> be needed to ensure that the memory blocks within postgresql are all 
> properly aligned to make sure that one isn't ping-ponging cache lines 
> around (usually done by padding the buffer sizes by an extra 32 bytes or 
> L1 line size).   Whatever you do, all the usual high performance 
> computing tricks should be used prior to considering any rewriting of 
> major code sections.

We have dealt with alignment and MemCpy is what we used for small-sized
copies to reduce function call overhead.  If you want to improve it,
feel free to take a look.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



view thread (173+ messages)  latest in thread

Message-ID: <200511230453.jAN4rGs24421@candle.pha.pa.us>
Permalink:  ../200511230453.jAN4rGs24421@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200511230453.jAN4rGs24421@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: pgman@candle.pha.pa.us, stange@rentec.com, gsstark@mit.edu, llonergan@greenplum.com, pg@fastcrypt.com, icub3d@gmail.com
  Subject: Re: Hardware/OS recommendations for large databases (
  In-Reply-To: <200511230453.jAN4rGs24421@candle.pha.pa.us>
  References: <4383E89C.8040200@rentec.com> <200511230453.jAN4rGs24421@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox