Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 857DE64FCE1 for ; Mon, 15 Sep 2008 14:33:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 25722-10 for ; Mon, 15 Sep 2008 14:33:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by postgresql.org (Postfix) with ESMTP id AB87C64FCE7 for ; Mon, 15 Sep 2008 14:33:40 -0300 (ADT) Received: by yx-out-2324.google.com with SMTP id 8so694003yxb.73 for ; Mon, 15 Sep 2008 10:33:39 -0700 (PDT) Received: by 10.142.229.5 with SMTP id b5mr2790025wfh.310.1221500018706; Mon, 15 Sep 2008 10:33:38 -0700 (PDT) Received: by 10.143.39.19 with HTTP; Mon, 15 Sep 2008 10:33:38 -0700 (PDT) Message-ID: Date: Mon, 15 Sep 2008 10:33:38 -0700 From: "Scott Carey" To: "Matthew Wakeling" Subject: Re: Effects of setting linux block device readahead size Cc: "pgsql-performance@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18153_17685320.1221500018702" References: <70c01d1d0809092353r4ae687a3ycf3d99d43a5680cf@mail.gmail.com> X-Google-Sender-Auth: 8ca00e66476eb521 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200809/175 X-Sequence-Number: 31488 ------=_Part_18153_17685320.1221500018702 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Good question. I'm in the process of completing more exhaustive tests with the various disk i/o schedulers. Basic findings so far: it depends on what type of concurrency is going on. Deadline has the best performance over a range of readahead values compared to cfq or anticipatory with concurrent sequential reads with xfs. However, mixing random and sequential reads puts cfq ahead with low readahead values and deadline ahead with large readahead values (I have not tried anticipatory here yet). However, your preference for prioritizing streaming over random will significantly impact which you would want to use and at what readahead value -- cfq does a better job at being consistent balancing the two, deadline swings strongly to being streaming biased as the readahead value gets larger and random biased when it is low. Deadline and CFQ are similar with concurrent random reads. I have not gotten to any write tests or concurrent read/write tests. I expect the anticipatory scheduler to perform worse with mixed loads -- anything asking a raid array that can do 1000 iops to wait for 7 ms and do nothing just in case a read in the same area might occur is a bad idea for aggregate concurrent throughput. It is a scheduler that assumes the underlying hardware is essentially one spindle -- which is why it is so good in a standard PC or laptop. But, I could be wrong. On Mon, Sep 15, 2008 at 9:18 AM, Matthew Wakeling wrote: > On Thu, 11 Sep 2008, Scott Carey wrote: > >> Preliminary summary: >> >> readahead | 8 conc read rate | 1 conc read rate >> 49152 | 311 | 314 >> 16384 | 312 | 312 >> 12288 | 304 | 309 >> 8192 | 292 | >> 4096 | 264 | >> 2048 | 211 | >> 1024 | 162 | 302 >> 512 | 108 | >> 256 | 81 | 300 >> 8 | 38 | >> > > What io scheduler are you using? The anticipatory scheduler is meant to > prevent this slowdown with multiple concurrent reads. > > Matthew > > > -- > And the lexer will say "Oh look, there's a null string. Oooh, there's > another. And another.", and will fall over spectacularly when it realises > there are actually rather a lot. > - Computer Science Lecturer (edited) > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > ------=_Part_18153_17685320.1221500018702 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Good question.  I'm in the process of completing = more exhaustive tests with the various disk i/o schedulers.

Basic fi= ndings so far:  it depends on what type of concurrency is going on.&nb= sp; Deadline has the best performance over a range of readahead values comp= ared to cfq or anticipatory with concurrent sequential reads with xfs. = ; However, mixing random and sequential reads puts cfq ahead with low reada= head values and deadline ahead with large readahead values (I have not trie= d anticipatory here yet).  However, your preference for prioritizing s= treaming over random will significantly impact which you would want to use = and at what readahead value -- cfq does a better job at being consistent ba= lancing the two, deadline swings strongly to being streaming biased as the = readahead value gets larger and random biased when it is low.  Deadlin= e and CFQ are similar with concurrent random reads.  I have not gotten= to any write tests or concurrent read/write tests.

I expect the anticipatory scheduler to perform worse with mixed loads -= - anything asking a raid array that can do 1000 iops to wait for 7 ms and d= o nothing just in case a read in the same area might occur is a bad idea fo= r aggregate concurrent throughput.  It is a scheduler that assumes the= underlying hardware is essentially one spindle -- which is why it is so go= od in a standard PC or laptop.   But, I could be wrong.

On Mon, Sep 15, 2008 at 9:18 AM, Matthew Wak= eling <matthew@= flymine.org> wrote:
On Thu, 11 Sep 2008, Scott Carey wrote:
Preliminary summary:


readahead  |  8 conc read rate  |  1 conc read rate
49152  |  311  |  314
16384  |  312  |  312
12288  |  304  |  309
 8192  |  292  |
 4096  |  264  |
 2048  |  211  |
 1024  |  162  |  302
  512  |  108  |
  256  |  81  | 300
    8  |  38  |

What io scheduler are you using? The anticipatory scheduler is meant to pre= vent this slowdown with multiple concurrent reads.

Matthew


--
And the lexer will say "Oh look, there's a null string. Oooh, ther= e's another. And another.", and will fall over spectacularly when = it realises
there are actually rather a lot.
       - Computer Science Lecturer (edited)

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

------=_Part_18153_17685320.1221500018702--