LKML Archive on
help / color / mirror / Atom feed
From: Nick Piggin <>
To: "Molnar, Ingo" <>, LKML <>
Subject: Poor PostgreSQL scaling on Linux 2.6.25-rc5 (vs 2.6.22)
Date: Tue, 11 Mar 2008 17:49:28 +1100	[thread overview]
Message-ID: <> (raw)

[-- Attachment #1: Type: text/plain, Size: 1838 bytes --]


After investigating the claims of poor MySQL performance on Linux,
I had a look at postgresql with sysbench. This DBMS is even faster
than MySQL and could scale up to more connections with my (as close
as possible) out of the box compile and config. The nice thing
about PostgreSQL is that it has no noticable contention on user
space locks on this workload.

The problem with MySQL contention means that if the scheduler
unluckily chooses to deschedule a lock holder, then you can get
idle time building up on other cores and you can get context switch
cascades as things all pile up onto this heavily contended lock. As
such, it means MySQL is not an ideal candidate for looking at
performance behaviour. I discounted the relatively worse scaling of
MySQL with 2.6.25-rc (than 2.6.22) as such an effect.

PostgreSQL is different. It has zero idle time when running this
workload. It actually scaled "super linearly" on my system here,
from single threaded performance to 8 cores (giving an 8.2x
performance increase)!

So PostgreSQL performance profile is actually much more interesting.
To my dismay, I found that Linux 2.6.25-rc5 performs really badly
after saturating the runqueues and subsequently increasing threads.
2.6.22 drops a little bit, but basically settles near the peak
performance. With 2.6.25-rc5, throughput seems to be falling off
linearly with the number of threads.

Actually, this performance profile sort of matches the MySQL curve,
so while I thought the MySQL numbers may be invalid, actually it
appears to back up the pgsql numbers.

This was with postgresql 8.3; config and kernel config available on
request. Looks very much like a CPU scheduler issue. Please take a

postgres.png contains 2.6.22 vs 2.6.25-rc5. compare.png contains
both of those plus MySQL on 2.6.22 vs 2.6.25-rc5.


[-- Attachment #2: postgres.png --]
[-- Type: image/png, Size: 3966 bytes --]

[-- Attachment #3: compare.png --]
[-- Type: image/png, Size: 5115 bytes --]

             reply	other threads:[~2008-03-11  6:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11  6:49 Nick Piggin [this message]
2008-03-11  7:58 ` Ingo Molnar
2008-03-11  8:28   ` Nick Piggin
2008-03-11  9:59     ` Ingo Molnar
2008-03-11 21:07 ` Nicholas Miell
2008-03-11 21:34   ` Cyrus Massoumi
2008-03-11 23:12     ` Nicholas Miell
2008-03-11 23:42       ` Nick Piggin
2008-03-11 23:47       ` Stephen Hemminger
2008-03-12  9:00       ` Zhang, Yanmin
     [not found] ` <>
     [not found]   ` <>
2008-03-12  1:21     ` Nick Piggin
2008-03-12  7:58       ` Peter Zijlstra
2008-03-17  0:44         ` Nick Piggin
2008-03-17  5:16           ` Ray Lee
2008-03-17  5:21             ` Willy Tarreau
2008-03-17  7:19               ` Nick Piggin
2008-03-17  8:26                 ` Willy Tarreau
2008-03-17  8:54                   ` Nick Piggin
2008-03-17  9:28                     ` Peter Zijlstra
2008-03-17  9:56                       ` Nick Piggin
2008-03-17 10:16                       ` Ingo Molnar
2008-03-17  5:34             ` Nick Piggin
2008-03-14 15:42 Xose Vazquez Perez

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Poor PostgreSQL scaling on Linux 2.6.25-rc5 (vs 2.6.22)' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).