Re: Straightforward changes for increased SMP scalability

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Straightforward changes for increased SMP scalability
Date: 2008-03-24 17:29:52
Message-ID: 200803241729.m2OHTqK19678@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Add to TODO:

* SMP scalability improvements

http://archives.postgresql.org/pgsql-hackers/2007-07/msg00439.php

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

Simon Riggs wrote:
> David Strong presented some excellent results of his SMP scalability
> testing at Ottawa in May.
> http://www.pgcon.org/2007/schedule/events/16.en.html
>
> There are some easy things we can do to take advantage of those results,
> especially the ones that were hardware independent.
>
> The hardware independent results were these two:
> - Avoid contention on WALInsertLock (+28% gain)
> - Increase NUM_BUFFER_PARTITIONS (+7.7% gain)
>
> Scalability begins to slow down at 8 CPUs on 8.2.4 and David was able to
> show good gains even at 8 CPUs with these changes.
>
> Proposals
>
> 1. For the first result, I suggest that we introduce some padding into
> the shmem structure XLogCtlData to alleviate false sharing that may
> exist between holders of WALInsertLock, WALWriteLock and info_lck. The
> cost of this will be at most about 200 bytes of shmem, with a low risk
> change. The benefits are hard to quantify, but we know this is an area
> of high contention and we should do all we can to reduce that.
> This hasn't been discussed previously, though we have seen good benefit
> from avoiding false sharing in other cases, e.g. LWLOCK padding.
>
> 2. Increase NUM_BUFFER_PARTITIONS from 16 to 256 (or higher).
> This has been discussed previously:
> http://archives.postgresql.org/pgsql-hackers/2006-09/msg00967.php
>
> Both of these changes are simple enough to consider for 8.3
>
> Comments?
>
> --
> Simon Riggs
> EnterpriseDB http://www.enterprisedb.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-03-24 17:30:58 Re: Straightforward changes for increased SMP scalability
Previous Message Bruce Momjian 2008-03-24 17:20:16 Re: script binaries renaming