pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
3+ messages / 2 participants
[nested] [flat]

* AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
@ 2021-05-04 07:40 Hans Buschmann <buschmann@nidsa.net>
  2021-05-04 15:50 ` AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Hans Buschmann <buschmann@nidsa.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Hans Buschmann @ 2021-05-04 07:40 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@gmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>


>No Windows here, but could it be super slow at launching workers?  How
>does a trivial parallel query compare, something like?

>SET force_parallel_mode = on;
>EXPLAIN ANALYZE SELECT 42;

indeed this query takes about 40ms in windows and 7ms on Linux (lowest values).

Due to remoting the machine the reported times vary quite a bit.

The problem seems that this (probably inherent) performance disadvantage of windows is not reflected in the cost model.

This causes little to middle complex queries to prioritize parallel execution on windows which is certainly not the best option in these cases.

The starting of processes should have an adequate cost penalty to guide the planner in the right direction.

Generally disabling parallel queries seems not a viable option with mixed loads.

Here are the query plans:

                                         QUERY PLAN Windows
--------------------------------------------------------------------------------------------
 Gather  (cost=1000.00..1000.11 rows=1 width=4) (actual time=34.995..38.207 rows=1 loops=1)
   Workers Planned: 1
   Workers Launched: 1
   Single Copy: true
   ->  Result  (cost=0.00..0.01 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)
 Planning Time: 0.016 ms
 Execution Time: 39.136 ms
(7 Zeilen)

                                        QUERY PLAN Linux
------------------------------------------------------------------------------------------
 Gather  (cost=1000.00..1000.11 rows=1 width=4) (actual time=6.864..7.764 rows=1 loops=1)
   Workers Planned: 1
   Workers Launched: 1
   Single Copy: true
   ->  Result  (cost=0.00..0.01 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=1)
 Planning Time: 0.026 ms
 Execution Time: 7.812 ms
(7 rows)


Hans Buschmann




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

* AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
  2021-05-04 07:40 AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Hans Buschmann <buschmann@nidsa.net>
@ 2021-05-04 15:50 ` Hans Buschmann <buschmann@nidsa.net>
  2021-05-04 16:46   ` Re: AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Hans Buschmann @ 2021-05-04 15:50 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@gmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Thank you Thomas for pointing me to this GUC which I haven't realized before.



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

* Re: AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
  2021-05-04 07:40 AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Hans Buschmann <buschmann@nidsa.net>
  2021-05-04 15:50 ` AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Hans Buschmann <buschmann@nidsa.net>
@ 2021-05-04 16:46   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2021-05-04 16:46 UTC (permalink / raw)
  To: Hans Buschmann <buschmann@nidsa.net>; +Cc: Thomas Munro <thomas.munro@gmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Hans Buschmann <buschmann@nidsa.net> writes:
> In my opinion, even for Linux the default for parallel_setup_cost is set too low (1000). It should reflect the sequential access of 1000 pages, which normally is faster from buffer cache on modern hardware.

I tend to agree with you that the default costs for parallel queries
are far too optimistic --- we've seen enough complaints about parallelism
making things slower to make that clear.  However, proposing some new
numbers without gathering some hard evidence to support them is not
helpful.

			regards, tom lane





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


end of thread, other threads:[~2021-05-04 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 07:40 AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64 Hans Buschmann <buschmann@nidsa.net>
2021-05-04 15:50 ` Hans Buschmann <buschmann@nidsa.net>
2021-05-04 16:46   ` Tom Lane <tgl@sss.pgh.pa.us>

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