pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
NUMA architecture and PostgreSQL
6+ messages / 4 participants
[nested] [flat]

* NUMA architecture and PostgreSQL
@ 2008-11-27 01:13 Fabricio <fabrixio1@hotmail.com>
  2008-11-27 09:20 ` Re: NUMA architecture and PostgreSQL Tino Schwarze <postgresql@tisc.de>
  2008-11-27 10:04 ` Re: NUMA architecture and PostgreSQL Marko Kreen <markokr@gmail.com>
  2008-11-28 10:32 ` Re: NUMA architecture and PostgreSQL lst_hoe02@kwsoft.de
  0 siblings, 3 replies; 6+ messages in thread

From: Fabricio @ 2008-11-27 01:13 UTC (permalink / raw)
  To: pgsql-admin


 
Hi...
 
I have an IBM server with NUMA architecture, two nodes with 4 CPU quad core and 64 GB of RAM each, and PostgrSQL 8.3.5. Is there any way to avoid the performance degradation when the load goes up and used the two nodes? I understand this performance degradation is due to the higher latency than a cpu access a remote memory that the  local memory. But there are ways to improve this?
 
http://archives.postgresql.org/pgsql-general/2005-04/msg01187.php
 
 
Any suggestions?     Greetings...             Thanks...
 
_________________________________________________________________
P.D. Live Search tiene una sorpresa buenísima, chécala aquí.
http://www.ganabuscando.com/Default.aspx=

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: NUMA architecture and PostgreSQL
  2008-11-27 01:13 NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
@ 2008-11-27 09:20 ` Tino Schwarze <postgresql@tisc.de>
  2008-11-27 16:45   ` Re: NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Tino Schwarze @ 2008-11-27 09:20 UTC (permalink / raw)
  To: pgsql-admin

On Wed, Nov 26, 2008 at 06:13:41PM -0700, Fabricio wrote:

> I have an IBM server with NUMA architecture, two nodes with 4 CPU quad
> core and 64 GB of RAM each, and PostgrSQL 8.3.5. Is there any way to
> avoid the performance degradation when the load goes up and used the
> two nodes? I understand this performance degradation is due to the
> higher latency than a cpu access a remote memory that the  local
> memory. But there are ways to improve this?
>  
> http://archives.postgresql.org/pgsql-general/2005-04/msg01187.php
>  
> Any suggestions?     Greetings...             Thanks...

I suppose this has nothing to do with PostgreSQL but needs some
operating system level tuning. Maybe there is a way to bind the postgres
processes to one node's CPUs... What operating system are you using?
I know that there are ways to bind processes to a CPU on Linux, I'm not
sure how to assign multiple processes to multiple CPUs. The Linux
scheduler should know about NUMA architectures though, there not that
new any more.

Tino.

-- 
"What we nourish flourishes." - "Was wir nähren erblüht."

www.lichtkreis-chemnitz.de
www.craniosacralzentrum.de



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: NUMA architecture and PostgreSQL
  2008-11-27 01:13 NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
  2008-11-27 09:20 ` Re: NUMA architecture and PostgreSQL Tino Schwarze <postgresql@tisc.de>
@ 2008-11-27 16:45   ` Fabricio <fabrixio1@hotmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Fabricio @ 2008-11-27 16:45 UTC (permalink / raw)
  To: postgresql@tisc.de; pgsql-admin


 > I suppose this has nothing to do with PostgreSQL but needs some> operating system level tuning. Maybe there is a way to bind the postgres> processes to one node's CPUs... What operating system are you using?
 
I am using Red Hat Enterprise 5.2, kernel  2.6.18-92.el5 x86_64
> I know that there are ways to bind processes to a CPU on Linux, I'm not> sure how to assign multiple processes to multiple CPUs. The Linux> scheduler should know about NUMA architectures though, there not that> new any more.
 
something like this?
numactl --membind=1 su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data/"
 this bind memory to node 1 to use the shared memory on node 1 and cpus preferred node 1. With this the other processes and S.O by default will use the node 0?
 
thanks... 
_________________________________________________________________
Realiza búsquedas en Internet y llévate hasta ¡Un Auto! 
http://www.ganabuscando.com/Default.aspx=

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: NUMA architecture and PostgreSQL
  2008-11-27 01:13 NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
@ 2008-11-27 10:04 ` Marko Kreen <markokr@gmail.com>
  2008-11-27 19:59   ` Re: NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Marko Kreen @ 2008-11-27 10:04 UTC (permalink / raw)
  To: Fabricio <fabrixio1@hotmail.com>; +Cc: pgsql-admin

On 11/27/08, Fabricio <fabrixio1@hotmail.com> wrote:
>  I have an IBM server with NUMA architecture, two nodes with 4 CPU quad core and 64 GB of RAM each, and PostgrSQL 8.3.5.
>
> Is there any way to avoid the performance degradation when the load goes up and used the two nodes?
>
> I understand this performance degradation is due to the higher latency than a cpu access a remote memory that the  local memory. But there are ways to improve this?
>
>  http://archives.postgresql.org/pgsql-general/2005-04/msg01187.php


You can use sched_setaffinity to select group of cpu-s for a process
and it's childs:

  http://www.kernel.org/doc/man-pages/online/pages/man2/sched_setaffinity.2.html

There is a bit higher level concept of cpusets too:

  http://www.kernel.org/doc/man-pages/online/pages/man7/cpuset.7.html

In both cases, you can either patch Postgres or write a launcher
that configures CPUs before executing postgres.

-- 
marko



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: NUMA architecture and PostgreSQL
  2008-11-27 01:13 NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
  2008-11-27 10:04 ` Re: NUMA architecture and PostgreSQL Marko Kreen <markokr@gmail.com>
@ 2008-11-27 19:59   ` Fabricio <fabrixio1@hotmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Fabricio @ 2008-11-27 19:59 UTC (permalink / raw)
  To: markokr@gmail.com; +Cc: pgsql-admin



Hi Marko, thanks for your help...
 
> There is a bit higher level concept of cpusets too:
> 
>   http://www.kernel.org/doc/man-pages/online/pages/man7/cpuset.7.html
>

> In both cases, you can either patch Postgres or write a launcher
> that configures CPUs before executing postgres.

This paragraph is the liks of cpuset:
       On systems with kernels compiled with built in support for cpusets, all
       processes are attached to a cpuset, and cpusets are always present.  If a
       system supports cpusets, then it will have the entry nodev cpuset in the file
       /proc/filesystems.  By mounting the cpuset file system (see the EXAMPLE
       section below), the administrator can configure the cpusets on a system to
       control the processor and memory placement of processes on that system.  By
       default, if the cpuset configuration on a system is not modified or if the
       cpuset file system is not even mounted, then the cpuset mechanism, though
       present, has no affect on the system's behavior.

Do I need to mount the cpuset file system for use numactl?


Example:
numactl --membind=1 su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -D 
/usr/local/pgsql/data/"

The two liks are about programing, but can I use only numactl with postgres? 

thanks  marko...


_________________________________________________________________
P.D. Live Search tiene una sorpresa buenísima, chécala aquí.
http://www.ganabuscando.com/Default.aspx=

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: NUMA architecture and PostgreSQL
  2008-11-27 01:13 NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
@ 2008-11-28 10:32 ` lst_hoe02@kwsoft.de
  2 siblings, 0 replies; 6+ messages in thread

From: lst_hoe02@kwsoft.de @ 2008-11-28 10:32 UTC (permalink / raw)
  To: pgsql-admin

Zitat von Fabricio <fabrixio1@hotmail.com>:

>
>
> Hi...
>
> I have an IBM server with NUMA architecture, two nodes with 4 CPU  
> quad core and 64 GB of RAM each, and PostgrSQL 8.3.5. Is there any  
> way to avoid the performance degradation when the load goes up and  
> used the two nodes? I understand this performance degradation is due  
> to the higher latency than a cpu access a remote memory that the   
> local memory. But there are ways to improve this?
>
> http://archives.postgresql.org/pgsql-general/2005-04/msg01187.php

As far as i can see PostgreSQL is not able to support NUMA? With a  
little search i get to rellay interesting links according to the  
problem and a potential solution supported by Oracle (using huge  
pages). Unfortunately PostgreSQL seams not using "huge pages" until  
now??

http://oss.linbit.com/hugetlb/
http://kevinclosson.wordpress.com/kevin-closson-index/oracle-on-opteron-k8l-numa-etc/

Any comments on this from PostgreSQL developers?

Regards

Andreas




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2008-11-28 10:32 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-11-27 01:13 NUMA architecture and PostgreSQL Fabricio <fabrixio1@hotmail.com>
2008-11-27 09:20 ` Tino Schwarze <postgresql@tisc.de>
2008-11-27 16:45   ` Fabricio <fabrixio1@hotmail.com>
2008-11-27 10:04 ` Marko Kreen <markokr@gmail.com>
2008-11-27 19:59   ` Fabricio <fabrixio1@hotmail.com>
2008-11-28 10:32 ` lst_hoe02@kwsoft.de

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