Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Christoph Berg
Re: Kevin Grittner 2014-07-01 <1404213492.98740.yahoomail...@web122306.mail.ne1.yahoo.com> > Andres Freund wrote: > > On 2014-07-01 11:01:04 +0200, Christoph Berg wrote: > > >> How much difference would it make if numactl --interleave=all > >> was used instead of using numa_interleave_memory() o

Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Kevin Grittner
Andres Freund wrote: > On 2014-07-01 11:01:04 +0200, Christoph Berg wrote: >> How much difference would it make if numactl --interleave=all >> was used instead of using numa_interleave_memory() on the shared >> memory segments? I guess that would make backend-local memory >> also interleaved, but

Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Andres Freund
On 2014-07-01 11:01:04 +0200, Christoph Berg wrote: > Re: Kevin Grittner 2014-06-09 > <1402267501.4.yahoomail...@web122304.mail.ne1.yahoo.com> > > @@ -536,6 +539,24 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int > > port, > > */ > > } > > > > +#ifdef USE_LIBNUMA >

Re: [HACKERS] NUMA packaging and patch

2014-07-01 Thread Christoph Berg
Re: Kevin Grittner 2014-06-09 <1402267501.4.yahoomail...@web122304.mail.ne1.yahoo.com> > @@ -536,6 +539,24 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int > port, >*/ > } > > +#ifdef USE_LIBNUMA > + /* > + * If this is not a private segment and we are

Re: [HACKERS] NUMA packaging and patch

2014-06-26 Thread Kevin Grittner
Claudio Freire wrote: > Sadly, it excludes the OS cache explicitly (when it mentions libc.so), > which is one of the hottest sources of memory bandwidth consumption in > a database. Agreed.  On the bright side, the packagers and/or sysadmins can fix this without any changes to the PostgreSQL cod

Re: [HACKERS] NUMA packaging and patch

2014-06-26 Thread Claudio Freire
On Thu, Jun 26, 2014 at 11:18 AM, Kohei KaiGai wrote: > One thing I concern is, it may conflict with numa-balancing > features that is supported in the recent Linux kernel; that > migrates physical pages according to the location of tasks > which references the page beyond the numa zone. > # I'm n

Re: [HACKERS] NUMA packaging and patch

2014-06-26 Thread Kohei KaiGai
Hello, Let me comment on this patch. It can be applied on head of the master branch, built and run regression test successfully. What this patch tries to do is quite simple and obvious. It suggests operating system to distribute physical pages to every numa nodes on allocation. One thing I conce

Re: [HACKERS] NUMA packaging and patch

2014-06-10 Thread Kevin Grittner
Josh Berkus wrote: > On 06/08/2014 03:45 PM, Kevin Grittner wrote: >> By default, the OS cache and buffers are allocated in the memory >> node with the shortest "distance" from the CPU a process is >> running on. > > Note that this will stop being the default in future Linux kernels. > However, we

Re: [HACKERS] NUMA packaging and patch

2014-06-10 Thread Josh Berkus
On 06/08/2014 03:45 PM, Kevin Grittner wrote: > By default, the OS cache and buffers are allocated in the memory > node with the shortest "distance" from the CPU a process is running > on. Note that this will stop being the default in future Linux kernels. However, we'll have to deal with the old

Re: [HACKERS] NUMA packaging and patch

2014-06-10 Thread Robert Haas
On Mon, Jun 9, 2014 at 1:00 PM, Kevin Grittner wrote: > Andres Freund wrote: >> On 2014-06-09 08:59:03 -0700, Kevin Grittner wrote: *) There is a lot of advice floating around (for example here: http://frosty-postgres.blogspot.com/2012/08/postgresql-numa-and-zone-reclaim-mode.html

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Kevin Grittner
Andres Freund wrote: > On 2014-06-09 08:59:03 -0700, Kevin Grittner wrote: >>> *) There is a lot of advice floating around (for example here: >>> http://frosty-postgres.blogspot.com/2012/08/postgresql-numa-and-zone-reclaim-mode.html >>> ) >>> to instruct operators to disable zone_reclaim.  Will y

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Andres Freund
On 2014-06-09 08:59:03 -0700, Kevin Grittner wrote: > > *) There is a lot of advice floating around (for example here: > > http://frosty-postgres.blogspot.com/2012/08/postgresql-numa-and-zone-reclaim-mode.html > > ) > > to instruct operators to disable zone_reclaim.  Will your changes > > invalida

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Kevin Grittner
Merlin Moncure wrote: > On Sun, Jun 8, 2014 at 5:45 PM, Kevin Grittner wrote: > Hm, your patch seems to boil down to >   interleave_memory(start, size, numa_all_nodes_ptr) > inside PGSharedMemoryCreate(). That's the functional part -- the rest is about not breaking the builds for environments w

Re: [HACKERS] NUMA packaging and patch

2014-06-09 Thread Merlin Moncure
On Sun, Jun 8, 2014 at 5:45 PM, Kevin Grittner wrote: > I ran into a situation where a machine with 4 NUMA memory nodes and > 40 cores had performance problems due to NUMA. The problems were > worst right after they rebooted the OS and warmed the cache by > running a script of queries to read all