title: presto + how to tune task.concurrency
body: <p>From presto document:</p>
  
  <p><code>task.concurrency</code> description:
  <a href="https://prestosql.io/docs/current/admin/properties.html" rel="nofollow noreferrer">https://prestosql.io/docs/current/admin/properties.html</a></p>
  
  <pre><code>    Type: integer
      Restrictions: must be a power of two
      Default value: 16
      Default local concurrency for parallel operators such as joins and aggregations. This value should be adjusted up or down based on the query concurrency and worker resource utilization. 
  Lower values are better for clusters that run many queries concurrently because the cluster will already be utilized by all the running queries, so adding more concurrency will result in slow downs due to context switching and other overhead. Higher values are better for clusters that only run one or a few queries at a time. This can also be specified on a per-query basis using the task_concurrency session property.
  </code></pre>
  
  <p>from my understanding -  we need to set the <code>task.concurrency</code> according to <code>CPU cores X Number of Thread</code></p>
  
  <p>I will give example from lscpu on one of the presto worker machines</p>
  
  <pre><code>lscpu
  Architecture:          x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
  CPU(s):                16
  On-line CPU(s) list:   0-15
  Thread(s) per core:    2
  </code></pre>
  
  <p><strong>because 16 X 2 = 32</strong></p>
  
  <p>then from my understanding its should be <code>task.concurrency=32</code> ?</p>
  
  <p>and this parameter should be configured only on <code>presto workers</code> in <code>config.properties</code> file</p>
  
  <p>am I right here?</p>