Zoltán Borók-Nagy created IMPALA-15864:
------------------------------------------

             Summary: CPC: MAX_FRAGMENT_INSTANCES_PER_NODE also lowers 
fragments that CPC sized below it; choose the per-node instance limit per 
fragment
                 Key: IMPALA-15864
                 URL: https://issues.apache.org/jira/browse/IMPALA-15864
             Project: IMPALA
          Issue Type: Improvement
          Components: Frontend
            Reporter: Zoltán Borók-Nagy


With COMPUTE_PROCESSING_COST=true, master applies one per-node instance limit 
to every fragment of a query: max(PROCESSING_COST_MIN_THREADS, 
min(MAX_FRAGMENT_INSTANCES_PER_NODE, cores)) from 
Analyzer.getMaxParallelismPerNode(). Lowering the option caps the scans, and it 
also lowers interior fragments that CPC sized from their producer's count, even 
when they were well below the limit: 
ProcessingCost.tryAdjustConsumerParallelism() multiplies the cost ratio by the 
producer's instance count, which is already capped. A partitioned join-build 
fragment copies its parent's count even when its own segment is heavier, 6.5x 
in TPC-H q21 below (see the TODO in 
PlanFragment.traverseEffectiveParallelism()). So no single value of the option 
suits a whole workload.

Example on master: 12 executors with 16 vCPUs each (8 cores x 2 threads), CPC, 
MT_DOP=0, the default (16 instances per node) against 
MAX_FRAGMENT_INSTANCES_PER_NODE=8, in 2 adjacent pairs.
* TPC-H SF1000, 3 iterations per run: 8 is 14.5% and 15.9% slower (sum of 
per-query best 205.8 -> 235.7 s and 200.8 -> 232.7 s). 11 of 22 queries are 
slower in all 6 iterations with 8 than in any default iteration, and none is 
faster. In q21, four partitioned-join fragments go from 2 to 1 instance per 
node, and the query from 29.8 to 45.1 s and from 28.8 to 44.0 s.
* TPC-DS SF10000, 1 iteration, one pair in each order: 8 is 12.9% and 8.5% 
faster (3662.0 -> 3190.3 s and 3448.6 -> 3156.3 s). q4, q65 and both parts of 
q23 give 301.4 of the 471.6 s and 248.8 of the 292.3 s. In a run of q23's first 
part alone, its six large hash exchanges have 43,776 instead of 170,496 
channels, and the byte-weighted network time per RPC is 27 instead of 162 ms.

Proposal, not built or measured: apply MAX_FRAGMENT_INSTANCES_PER_NODE as a 
final clamp after the traversal in Planner.computeEffectiveParallelism(), so 
that fragments CPC sizes below the option keep their count. Then choose the 
limit per fragment: the logical core count by default, and fewer, for example 
the physical core count, for fragments that send or receive a large partitioned 
exchange, because its channels grow with the square of the instances per node. 
Size a partitioned join build and its parent from the heavier of the two, as 
the TODO says. Plan-time exchange estimates can be far off (q21: 600M rows 
estimated, 3.79G actual), so the exchange-size input needs validation.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to