Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUsxp-0003YT-Li for pgsql-performance@arkaria.postgresql.org; Tue, 11 Jul 2017 11:04:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dUsxo-0004Qu-Lb for pgsql-performance@arkaria.postgresql.org; Tue, 11 Jul 2017 11:04:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dUsw2-0001Lm-3V for pgsql-performance@postgresql.org; Tue, 11 Jul 2017 11:02:30 +0000 Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dUsvy-00089f-J6 for pgsql-performance@postgresql.org; Tue, 11 Jul 2017 11:02:28 +0000 Received: by mail-qk0-x234.google.com with SMTP id d78so98139692qkb.1 for ; Tue, 11 Jul 2017 04:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tQNqwvzFujR7PyZLAnERxizixt1vylLMq3Vf6JhKSLU=; b=m1ZVVpX6+KTsl9eQfrhTHtMdERFKliKkBCRt77hvxKGzKLezfCXtgo6LCZ7u7s4LJA 8JQMq4KHS0oMNEIjkNIofN1OyM+jxh8EgpUM/3/v68W0252rVAGC6BywZsUWBEtsb3cP P4rQ5NS5FLSU5J+53dvWXdBS+a5EmhKy2H84ANTjc/9ul6OL2gTfDZExQUll4qQi3DjR OXcdCJcsQA9vkAwpW8nm3xlMjOJd1DF/IZQXDNn1Pb/WuJ4WYH3D8p5mM9aTUcE6bwQQ o1KTZD4S/vIIn6DKpS5h4Xqyp9deROP6f7Zxcg0rG/JzN1ZNCKICH2pjT0pCH1IFrFfl HuNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tQNqwvzFujR7PyZLAnERxizixt1vylLMq3Vf6JhKSLU=; b=nZqPVwKEBKLyo1LzR2J/2gl1m3M/+2GK1F+59zDUifLj1QVvnGEFYAdl2VWms3ttS8 2nFv48VBVHYI7TtuIwUxpAwpK3x+yNQQfNUnuc1hBjnYgPY2S076qllhStJdl8kOwIOw E/EVZAop5HTko6pMfoond6dLpGey65O4APJ+TtHLFl3tfDyqilKn0hyb2Qj8vuHFMQv6 yS2fuyWRNjbwwahecrBj2Qd/2puap6YfcLQmjoPsL+0CdZfQgqp7UJuO7rCpmldC7vvA JdYk5XkmxSG6+r7ZQJZhv1jWnaMaRX8edj6co+IcB/YfuizxFeahWz3i7tr6E5ScXCjD xEew== X-Gm-Message-State: AIVw113JZkzVufuE9/Xhzc80ZBSRtSmNu2H3xutRn/qBrdZDaZ2wTX8M irELBFPGPfEPgCxZGM1rmUD/QLcBPIXx X-Received: by 10.200.58.4 with SMTP id w4mr10273367qte.188.1499770945701; Tue, 11 Jul 2017 04:02:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.157.11 with HTTP; Tue, 11 Jul 2017 04:02:05 -0700 (PDT) In-Reply-To: References: From: Charles Nadeau Date: Tue, 11 Jul 2017 13:02:05 +0200 Message-ID: Subject: Re: Very poor read performance, query independent To: Jeff Janes Cc: "pgsql-performance@postgresql.org" Content-Type: multipart/alternative; boundary="94eb2c1252aa768cd3055408a250" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --94eb2c1252aa768cd3055408a250 Content-Type: text/plain; charset="UTF-8" Jeff, I used fio in a quick benchmarking script inspired by https://smcleod.net/benchmarking-io/: #!/bin/bash #Random throughput echo "Random throughput" sync fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=randread --ramp_time=4 #Random IOPS echo "Random IOPS" sync fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=256 --size=4G --readwrite=randread --ramp_time=4 #Sequential throughput echo "Sequential throughput" sync fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=read --ramp_time=4 #Sequential IOPS echo "Sequential IOPS" sync fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=256 --size=4G --readwrite=read --ramp_time=4 Performing the test you suggested, I get 128.5MB/s. Monitoring the test, I find that the throughput is constant from start to finish and that the iowait is also constant at 5%: charles@hpdl380g6:~$ sudo sh -c 'time cat /mnt/data/postgresql/base/16385/* | wc -c' [sudo] password for charles: 1.62user 179.94system 29:50.79elapsed 10%CPU (0avgtext+0avgdata 1920maxresident)k 448026264inputs+0outputs (0major+117minor)pagefaults 0swaps 241297594904 After making the changes to HugePage suggested by Rick Otten (above), I found slightly better results (135.7MB/s): charles@hpdl380g6:~$ sudo sh -c 'time cat /mnt/data/postgresql/base/16385/* | wc -c' [sudo] password for charles: 0.86user 130.84system 28:15.78elapsed 7%CPU (0avgtext+0avgdata 1820maxresident)k 471286792inputs+0outputs (1major+118minor)pagefaults 0swaps 241297594904 Could you suggest another way to benchmark random reads? Thanks for your help! Charles On Mon, Jul 10, 2017 at 9:24 PM, Jeff Janes wrote: > On Mon, Jul 10, 2017 at 7:03 AM, Charles Nadeau > wrote: > >> >> The problem I have is very poor read. When I benchmark my array with fio >> I get random reads of about 200MB/s and 1100IOPS and sequential reads of >> about 286MB/s and 21000IPS. >> > > > That doesn't seem right. Sequential is only 43% faster? What job file > are giving to fio? > > What do you get if you do something simpler, like: > > time cat ~/$PGDATA/base/16402/*|wc -c > > replacing 16402 with whatever your biggest database is. > > Cheers, > > Jeff > -- Charles Nadeau Ph.D. http://charlesnadeau.blogspot.com/ --94eb2c1252aa768cd3055408a250 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Jeff,

I used fio in a quick = benchmarking script inspired by https://smcleod.net/benchmarking-io/:
#!/bin/bash
#Rando= m throughput
echo "Random throughput"
sync
fio --randrepeat=3D1 --ioengine=3Dlibaio --direct=3D1 --gtod_reduce= =3D1 --name=3Dtest --filename=3Dtest --bs=3D4M --iodepth=3D256 --size=3D10G= --readwrite=3Drandread --ramp_time=3D4
#Random IOPS
ec= ho "Random IOPS"
sync
fio --randrepeat=3D1 --= ioengine=3Dlibaio --direct=3D1 --gtod_reduce=3D1 --name=3Dtest --filename= =3Dtest --bs=3D4k --iodepth=3D256 --size=3D4G --readwrite=3Drandread --ramp= _time=3D4
#Sequential throughput
echo "Sequential = throughput"
sync
fio --randrepeat=3D1 --ioengine= =3Dlibaio --direct=3D1 --gtod_reduce=3D1 --name=3Dtest --filename=3Dtest --= bs=3D4M --iodepth=3D256 --size=3D10G --readwrite=3Dread --ramp_time=3D4
#Sequential IOPS
echo "Sequential IOPS"
sync
fio --randrepeat=3D1 --ioengine=3Dlibaio --direct=3D1 --gt= od_reduce=3D1 --name=3Dtest --filename=3Dtest --bs=3D4k --iodepth=3D256 --s= ize=3D4G --readwrite=3Dread --ramp_time=3D4

Performing the test you suggested, I get 128.5MB/s. Monitoring the t= est, I find that the throughput is constant from start to finish and that t= he iowait is also constant at 5%:
charles@hpdl380g6:~$ sudo sh -c 'time = cat /mnt/data/postgresql/base/16385/* | wc -c'
[sudo] passwor= d for charles:=C2=A0
1.62user 179.94system 29:50.79elapsed 10%CPU= (0avgtext+0avgdata 1920maxresident)k
448026264inputs+0outputs (0= major+117minor)pagefaults 0swaps
241297594904
<= div>
After making the changes to HugePage suggested by Rick O= tten (above), I found slightly better results (135.7MB/s):
charles@hpdl380g6= :~$ sudo sh -c 'time cat /mnt/data/postgresql/base/16385/* | wc -c'=
[sudo] password for charles:=C2=A0
0.86user 130.84syst= em 28:15.78elapsed 7%CPU (0avgtext+0avgdata 1820maxresident)k
471= 286792inputs+0outputs (1major+118minor)pagefaults 0swaps
24129759= 4904

Could you suggest another way to= benchmark random reads?

Thanks for your help!

Charles

On Mon, Jul 10, 2017 at 9:24 PM, Jeff Janes <je= ff.janes@gmail.com> wrote:
=
On Mon, Jul 10, 2017 at 7:03 AM, Charles Nadeau <charl= es.nadeau@gmail.com> wrote:
=09 =09 =09


The problem I have is very poor read. When I benchmark my array with fio I get random reads of about 200MB/s and 1100IOPS and sequential reads of about 286MB/s and 21000IPS.



=
That doesn't seem right.=C2=A0 Sequential is only 43% faste= r?=C2=A0 What job file are giving to fio?

What do = you get if you do something simpler, like:=C2=A0

t= ime cat ~/$PGDATA/base/16402/*|wc -c

replacing= 16402 with whatever your biggest database is.

Che= ers,

Jeff



--
--94eb2c1252aa768cd3055408a250--