You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@quickstep.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/04 18:24:58 UTC

[jira] [Commented] (QUICKSTEP-41) Auto pinning of worker threads

    [ https://issues.apache.org/jira/browse/QUICKSTEP-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15637250#comment-15637250 ] 

ASF GitHub Bot commented on QUICKSTEP-41:
-----------------------------------------

GitHub user hbdeshmukh opened a pull request:

    https://github.com/apache/incubator-quickstep/pull/126

    QUICKSTEP-41 Automatically pin workers to CPU cores

    - Automatically pin worker threads to CPU cores.
    - Use auto pinning when either there are no affinities provided, or the provided affinities are incorrect.
    - Try to balance CPU cores across multiple sockets, when maximum parallelism is not used.
    
    Shown below is a demonstration of this PR in action. 
    ```
    $ numactl --hardware
    available: 2 nodes (0-1)
    node 0 cpus: 0 1 2 3 4 5 12 13 14 15 16 17
    node 1 cpus: 6 7 8 9 10 11 18 19 20 21 22 23
    ```
    
    The machine has 2 NUMA sockets and 24 CPUs, with 12 CPUS on each NUMA socket. Next we run Quickstep without any hints on number of workers and their affinities. 
    
    ```
    $ GLOG_v=1 GLOG_logtostderr=1 ./quickstep_cli_shell
    Quickstep expects at least one worker thread, switching to the default number of worker threads
    Starting Quickstep with 24 worker thread(s) and a 21.97 GB buffer pool
    Empty worker affinities provided, switching to default worker affinities
    Affinities: 0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 12, 18, 13, 19, 14, 20, 15, 21, 16, 22, 17, 23
    ```
    
    ```
    $ GLOG_v=1 GLOG_logtostderr=1 ./quickstep_cli_shell -num_workers=24
    Starting Quickstep with 24 worker thread(s) and a 21.97 GB buffer pool
    Empty worker affinities provided, switching to default worker affinities
    Affinities: 0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 12, 18, 13, 19, 14, 20, 15, 21, 16, 22, 17, 23
    
    $ GLOG_v=1 GLOG_logtostderr=1 ./quickstep_cli_shell -num_workers=2
    Starting Quickstep with 2 worker thread(s) and a 21.97 GB buffer pool
    Empty worker affinities provided, switching to default worker affinities
    Affinities: 0, 6
    
    $ GLOG_v=1 GLOG_logtostderr=1 ./quickstep_cli_shell -num_workers=5
    Starting Quickstep with 5 worker thread(s) and a 21.97 GB buffer pool
    Empty worker affinities provided, switching to default worker affinities
    Affinities: 0, 6, 1, 7, 2
    ```
    
    Right now we don't over-subscribe worker threads to CPU cores. If there are more workers than the affinities (not recommended anyway), extra workers are not affinitized to any CPU core. 
    
    ```
    $ GLOG_v=1 GLOG_logtostderr=1 ./quickstep_cli_shell -num_workers=25
    Starting Quickstep with 25 worker thread(s) and a 21.97 GB buffer pool
    Empty worker affinities provided, switching to default worker affinities
    --num_workers is 25, but only specified 24 CPU affinities with --worker_affinities. 1 workers will be unaffinitized.
    Affinities: 0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 12, 18, 13, 19, 14, 20, 15, 21, 16, 22, 17, 23, -1
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-quickstep auto-worker-pinning

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-quickstep/pull/126.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #126
    
----
commit 248cec27341fa8f19658d0705c1dca3fec0ff550
Author: Harshad Deshmukh <hb...@apache.org>
Date:   2016-11-04T04:34:37Z

    Auto pin workers to CPU cores
    
    - Automatically pin worker threads to CPU cores.
    - Use auto pinning when either there are no affinities provided, or the
      provided affinities are incorrect.
    - Try to balance CPU cores across multiple sockets, when maximum
      paralellism is not used.

----


> Auto pinning of worker threads
> ------------------------------
>
>                 Key: QUICKSTEP-41
>                 URL: https://issues.apache.org/jira/browse/QUICKSTEP-41
>             Project: Apache Quickstep
>          Issue Type: Improvement
>          Components: Query Execution
>         Environment: Multicore hardware with Linux operating system
>            Reporter: Harshad Deshmukh
>            Assignee: Harshad Deshmukh
>            Priority: Minor
>              Labels: performance
>
> The Quickstep process without any additional flags regarding worker affinities does not pin the worker threads to the cores. We should pin the worker threads automatically, which will help improve the query performance, as the OS will not migrate the worker threads due to the pinning.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)