pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vitaliy Garnashevich <vgarnashevich@gmail.com>
To: pgsql-performance@lists.postgresql.org
Subject: effective_io_concurrency on EBS/gp2
Date: Wed, 31 Jan 2018 14:03:17 +0200
Message-ID: <6c7a45df-f6ab-f2ce-6f84-9555864f6c86@gmail.com> (raw)

Hi,

I've tried to run a benchmark, similar to this one:

https://www.postgresql.org/message-id/flat/CAHyXU0yiVvfQAnR9cyH%3DHWh1WbLRsioe%3DmzRJTHwtr%3D2azsTdQ...

CREATE TABLESPACE test OWNER postgres LOCATION '/path/to/ebs';

pgbench -i -s 1000 --tablespace=test pgbench

echo "" >test.txt
for i in 0 1 2 4 8 16 32 64 128 256 ; do
   sync; echo 3 > /proc/sys/vm/drop_caches; service postgresql restart
   echo "effective_io_concurrency=$i" >>test.txt
   psql pgbench -c "set effective_io_concurrency=$i; set 
enable_indexscan=off; explain (analyze, buffers)  select * from 
pgbench_accounts where aid between 1000 and 10000000 and abalance != 0;" 
 >>test.txt
done

I get the following results:

effective_io_concurrency=0
  Execution time: 40262.781 ms
effective_io_concurrency=1
  Execution time: 98125.987 ms
effective_io_concurrency=2
  Execution time: 55343.776 ms
effective_io_concurrency=4
  Execution time: 52505.638 ms
effective_io_concurrency=8
  Execution time: 54954.024 ms
effective_io_concurrency=16
  Execution time: 54346.455 ms
effective_io_concurrency=32
  Execution time: 55196.626 ms
effective_io_concurrency=64
  Execution time: 55057.956 ms
effective_io_concurrency=128
  Execution time: 54963.510 ms
effective_io_concurrency=256
  Execution time: 54339.258 ms

The test was using 100 GB gp2 SSD EBS. More detailed query plans are 
attached.

PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 
5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609, 64-bit

The results look really confusing to me in two ways. The first one is 
that I've seen recommendations to set effective_io_concurrency=256 (or 
more) on EBS. The other one is that effective_io_concurrency=1 (the 
worst case) is actually the default for PostgreSQL on Linux.

Thoughts?

Regards,
Vitaliy

Attachments:

test.txt (text/plain, 9.9K) download effective_io_concurrency=0 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=40261.322..40261.322 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3366.623..3366.623 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 17.285 ms Execution time: 40262.781 ms (12 rows) effective_io_concurrency=1 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=98124.607..98124.607 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3373.380..3373.380 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 18.110 ms Execution time: 98125.987 ms (12 rows) effective_io_concurrency=2 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=55340.663..55340.663 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3306.896..3306.896 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 30.986 ms Execution time: 55343.776 ms (12 rows) effective_io_concurrency=4 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=52504.298..52504.298 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3332.724..3332.724 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 17.100 ms Execution time: 52505.638 ms (12 rows) effective_io_concurrency=8 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=54952.558..54952.558 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3390.833..3390.833 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 18.043 ms Execution time: 54954.024 ms (12 rows) effective_io_concurrency=16 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=54345.036..54345.036 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3401.819..3401.819 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 17.164 ms Execution time: 54346.455 ms (12 rows) effective_io_concurrency=32 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=55195.211..55195.211 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3373.154..3373.154 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 18.490 ms Execution time: 55196.626 ms (12 rows) effective_io_concurrency=64 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=55056.559..55056.559 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3351.440..3351.440 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 17.142 ms Execution time: 55057.956 ms (12 rows) effective_io_concurrency=128 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=54962.081..54962.081 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3410.678..3410.678 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 17.441 ms Execution time: 54963.510 ms (12 rows) effective_io_concurrency=256 QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on pgbench_accounts (cost=137192.84..1960989.89 rows=1 width=97) (actual time=54337.825..54337.825 rows=0 loops=1) Recheck Cond: ((aid >= 1000) AND (aid <= 10000000)) Rows Removed by Index Recheck: 23 Filter: (abalance <> 0) Rows Removed by Filter: 9999001 Heap Blocks: exact=97869 lossy=66050 Buffers: shared hit=3 read=191240 -> Bitmap Index Scan on pgbench_accounts_pkey (cost=0.00..137192.84 rows=10540117 width=0) (actual time=3380.008..3380.008 rows=9999001 loops=1) Index Cond: ((aid >= 1000) AND (aid <= 10000000)) Buffers: shared hit=3 read=27321 Planning time: 16.987 ms Execution time: 54339.258 ms (12 rows)

view thread (21+ messages)  latest in thread

Message-ID: <6c7a45df-f6ab-f2ce-6f84-9555864f6c86@gmail.com>
Permalink:  ../6c7a45df-f6ab-f2ce-6f84-9555864f6c86@gmail.com/
Also on:    postgresql.org/message-id/6c7a45df-f6ab-f2ce-6f84-9555864f6c86@gmail.com

 · 

reply

Reply instructions:

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

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: vgarnashevich@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: effective_io_concurrency on EBS/gp2
  In-Reply-To: <6c7a45df-f6ab-f2ce-6f84-9555864f6c86@gmail.com>

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

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