pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
effective_io_concurrency
7+ messages / 5 participants
[nested] [flat]

* effective_io_concurrency
@ 2011-02-02 21:16  Yves Weißig <weissig@rbg.informatik.tu-darmstadt.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Yves Weißig @ 2011-02-02 21:16 UTC (permalink / raw)
  To: pgsql-general

Hi pgsql-general group,

I was wondering if there is more information about this switch in the
configuration. Does it really work? Where in the source code can I
follow how it works? "sgmgr.c" seems to be an entry point, but where
exactly is it used?

Greets, Yves



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: effective_io_concurrency
@ 2011-02-03 16:15  Greg Smith <greg@2ndquadrant.com>
  parent: Yves Weißig <weissig@rbg.informatik.tu-darmstadt.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Greg Smith @ 2011-02-03 16:15 UTC (permalink / raw)
  To: weissig@rbg.informatik.tu-darmstadt.de; +Cc: pgsql-general

Yves Weißig wrote:
> I was wondering if there is more information about this switch in the
> configuration. Does it really work? Where in the source code can I
> follow how it works? "sgmgr.c" seems to be an entry point, but where
> exactly is it used?
>   

Currently the code only kicks in when you're doing a Bitmap Heap Scan, 
which is really helpful for them, but of no help for any other type of 
query.  This style of heap scan already knows in advance exactly what 
blocks it needs from the database, and normally it just asks for them 
one at a time.  That can turn into a fair amount of random I/O, and it's 
done serially:  the next block isn't requested until the last one 
arrives.  What effective_io_concurrency does is advise the operating 
system of the next few blocks the database is going to ask for, before 
the actual read requests, in hopes that it might grab them if it happens 
to be nearby that area of the disk.e

I've only seen this feature work at all on Linux. It might work on BSD 
and Mac OS X systems, it certainly doesn't do anything on Solaris and 
Windows.

The basic idea is that you start with setting the value to the number of 
working drives in the disk array the database is on and see if I/O 
performance goes up and/or query speed drops afterwards. If it does you 
might try further increases beyond that even. As for why there isn't a 
better tuning guide than just those simple guidelines, it's not that 
easy to show a situation where the type of bitmap scan this parameter 
impacts is used on a generated data set, even though it's not that 
uncommon in real-world data. It's hard both to make generic suggestions 
here and to even demonstrate the feature at work.

Moving up the source code chain from smgr, 
src/backend/storage/buffer/bufmgr.c has PrefetchBuffer, and the one 
place the executor calls that is BitmapHeapNext inside 
src/backend/executor/nodeBitmapHeapscan.c

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: effective_io_concurrency
@ 2011-02-06 14:14  Yves Weißig <weissig@rbg.informatik.tu-darmstadt.de>
  parent: Greg Smith <greg@2ndquadrant.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Yves Weißig @ 2011-02-06 14:14 UTC (permalink / raw)
  To: Greg Smith <greg@2ndquadrant.com>; +Cc: pgsql-general

Thanks for the detailed answer and explanation.
I am curious if there is another way to force this behaviour. As a part
of my masters thesis I am trying to develop an index which heavily
relies on requesting blocks in parallel. Without knowing the code, do I
have to dive into it and change it manually or can I accomplish this any
other way?

Am 03.02.2011 17:15, schrieb Greg Smith:
> Yves Weißig wrote:
>> I was wondering if there is more information about this switch in the
>> configuration. Does it really work? Where in the source code can I
>> follow how it works? "sgmgr.c" seems to be an entry point, but where
>> exactly is it used?
>>   
> 
> Currently the code only kicks in when you're doing a Bitmap Heap Scan,
> which is really helpful for them, but of no help for any other type of
> query.  This style of heap scan already knows in advance exactly what
> blocks it needs from the database, and normally it just asks for them
> one at a time.  That can turn into a fair amount of random I/O, and it's
> done serially:  the next block isn't requested until the last one
> arrives.  What effective_io_concurrency does is advise the operating
> system of the next few blocks the database is going to ask for, before
> the actual read requests, in hopes that it might grab them if it happens
> to be nearby that area of the disk.e
> 
> I've only seen this feature work at all on Linux. It might work on BSD
> and Mac OS X systems, it certainly doesn't do anything on Solaris and
> Windows.
> 
> The basic idea is that you start with setting the value to the number of
> working drives in the disk array the database is on and see if I/O
> performance goes up and/or query speed drops afterwards. If it does you
> might try further increases beyond that even. As for why there isn't a
> better tuning guide than just those simple guidelines, it's not that
> easy to show a situation where the type of bitmap scan this parameter
> impacts is used on a generated data set, even though it's not that
> uncommon in real-world data. It's hard both to make generic suggestions
> here and to even demonstrate the feature at work.
> 
> Moving up the source code chain from smgr,
> src/backend/storage/buffer/bufmgr.c has PrefetchBuffer, and the one
> place the executor calls that is BitmapHeapNext inside
> src/backend/executor/nodeBitmapHeapscan.c
> 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Effective IO Concurrency
@ 2020-09-14 13:39  luis.roberto@siscobra.com.br
  0 siblings, 1 reply; 7+ messages in thread

From: luis.roberto@siscobra.com.br @ 2020-09-14 13:39 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Hi! 

In PostgreSQL 13, the way of using effective_io_concurrency has changed. Until v12, I used 200 for this value (using SSD drives). Using the new formula described in [ https://www.postgresql.org/docs/13/release-13.html | https://www.postgresql.org/docs/13/release-13.html ] gives me 1176. However, in the documentation [ https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY | https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY ] it says that the maximum value allowed is 1000. 

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Effective IO Concurrency
@ 2020-09-14 16:03  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: luis.roberto@siscobra.com.br
  0 siblings, 1 reply; 7+ messages in thread

From: Laurenz Albe @ 2020-09-14 16:03 UTC (permalink / raw)
  To: luis.roberto@siscobra.com.br, pgsql-general <pgsql-general@lists.postgresql.org>

On Mon, 2020-09-14 at 10:39 -0300, luis.roberto@siscobra.com.br wrote:
> In PostgreSQL 13, the way of using effective_io_concurrency has changed. Until v12,
>  I used 200 for this value (using SSD drives). Using the new formula described in
> https://www.postgresql.org/docs/13/release-13.html gives me 1176.
>  However, in the documentation https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY
> it says that the maximum value allowed is 1000.

Then use the value 1000...

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Effective IO Concurrency
@ 2020-09-14 16:10  Ron <ronljohnsonjr@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 7+ messages in thread

From: Ron @ 2020-09-14 16:10 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 9/14/20 11:03 AM, Laurenz Albe wrote:
> On Mon, 2020-09-14 at 10:39 -0300, luis.roberto@siscobra.com.br wrote:
>> In PostgreSQL 13, the way of using effective_io_concurrency has changed. Until v12,
>>   I used 200 for this value (using SSD drives). Using the new formula described in
>> https://www.postgresql.org/docs/13/release-13.html gives me 1176.
>>   However, in the documentation https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY
>> it says that the maximum value allowed is 1000.
> Then use the value 1000...

I think he means that the formula should take that into account.

-- 
Angular momentum makes the world go 'round.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Effective IO Concurrency
@ 2020-09-14 16:25  luis.roberto@siscobra.com.br
  parent: Ron <ronljohnsonjr@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: luis.roberto@siscobra.com.br @ 2020-09-14 16:25 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

De: "Ron" <ronljohnsonjr@gmail.com> 
Para: "pgsql-general" <pgsql-general@lists.postgresql.org> 
Enviadas: Segunda-feira, 14 de setembro de 2020 13:10:23 
Assunto: Re: Effective IO Concurrency 

On 9/14/20 11:03 AM, Laurenz Albe wrote: 
> On Mon, 2020-09-14 at 10:39 -0300, luis.roberto@siscobra.com.br wrote: 
>> In PostgreSQL 13, the way of using effective_io_concurrency has changed. Until v12, 
>> I used 200 for this value (using SSD drives). Using the new formula described in 
>> https://www.postgresql.org/docs/13/release-13.html gives me 1176. 
>> However, in the documentation https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY 
>> it says that the maximum value allowed is 1000. 
> Then use the value 1000... 

I think he means that the formula should take that into account. 

-- 
Angular momentum makes the world go 'round. 

Exactly.... 

For future reference, and maybe a updated documentation: 

SELECT least(round(sum(OLD / n::float)),1000) FROM generate_series(1, OLD) s(n) 

I don't know how to write patches, so maybe someone can do that. 

Thanks. 

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2020-09-14 16:25 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 21:16 effective_io_concurrency Yves Weißig <weissig@rbg.informatik.tu-darmstadt.de>
2011-02-03 16:15 ` Greg Smith <greg@2ndquadrant.com>
2011-02-06 14:14   ` Yves Weißig <weissig@rbg.informatik.tu-darmstadt.de>
2020-09-14 13:39 Effective IO Concurrency luis.roberto@siscobra.com.br
2020-09-14 16:03 ` Re: Effective IO Concurrency Laurenz Albe <laurenz.albe@cybertec.at>
2020-09-14 16:10   ` Re: Effective IO Concurrency Ron <ronljohnsonjr@gmail.com>
2020-09-14 16:25     ` Re: Effective IO Concurrency luis.roberto@siscobra.com.br

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