cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] jonmeredith opened a new pull request #369: Enables users to resize the thread pools at runtime (CASSANDRA-15277v3)
Date Wed, 23 Oct 2019 20:29:56 GMT
jonmeredith opened a new pull request #369: Enables users to resize the thread pools at runtime
(CASSANDRA-15277v3)
URL: https://github.com/apache/cassandra/pull/369
 
 
   See [CASSANDRA-15277](https://issues.apache.org/jira/browse/CASSANDRA-15277)
   
   This patch enables users to resize the thread pools used by the various processing stages
at runtime using nodetool or over JMX.
   
   Changes:
   
   Switch to using idiomatic Java Executor names for thread pool configuration functions.
 Deprecate `{get,set}CoreThreads` for `{get,set}CorePoolSize`, `{get,set}MaximumThreads` for
`{get,set}MaximumPoolSize`.
   
   Introduce a new ResizableThreadPool interface used by SEPExecutorMBean and JMXEnabledThreadPoolExecutorMBean
to expose a common interface for setting thread pool sizes.  Replace singled usage of JMXConfigurableThreadPoolExecutor
in repair code with JMXEnabledThreadPoolExecutor as both are now resizable (since CASSANDRA-5044)
and ResizableThreadPool now exporting the same API over JMX.
   
   Implement {get,set}CorePoolSize and {get,set}MaximumPoolSize for SEPExecutor. To change
the maximum pool size for SEPExecutor, the number of permits has been changed so that it can
go negative if the size of the pool is reduced.  If a SEPWorker discovers the number of permits
is negative when looking for more work it stops.
   
   Add `nodetool getconcurrency` to retrieve the current core and maximum pool sizes for all
of the executor stages and `nodetool setconcurrency`to change core/maximum pool sizes where
permitted.
   
   Update StageManager and the executors to pass a consumer function thatupdates the configuration
used to initialize the thread pools. This keeps the config in sync with changes made over
JMX to `org.apache.cassandra.{request,internal}.*` or via nodetool. Also implement for native
transport threads - although that can currently only be updated by JMX rather than nodetool.
   
   Introduce a new `JMXEnabledSingleThreadedExecutor` for executors that need to be single
threaded for correctness that forbids changing the core/maximum pool sizes (previously it
was possible to set gossip to run multiple threads over JMX).
   
   Nodetool Syntax
   ```
   $ bin/nodetool help getconcurrency 
   NAME
           nodetool getconcurrency - Get maximum concurrency for processing stages
   
   SYNOPSIS
           nodetool [(-h <host> | --host <host>)] [(-p <port> | --port <port>)]
                   [(-pp | --print-port)] [(-pw <password> | --password <password>)]
                   [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
                   [(-u <username> | --username <username>)] getconcurrency [--]
                   [pool-names]
   
   OPTIONS
           -h <host>, --host <host>
               Node hostname or ip address
   
           -p <port>, --port <port>
               Remote jmx agent port number
   
           -pp, --print-port
               Operate in 4.0 mode with hosts disambiguated by port number
   
           -pw <password>, --password <password>
               Remote jmx agent password
   
           -pwf <passwordFilePath>, --password-file <passwordFilePath>
               Path to the JMX password file
   
           -u <username>, --username <username>
               Remote jmx agent username
   
           --
               This option can be used to separate command-line options from the
               list of argument, (useful when arguments might be mistaken for
               command-line options
   
           [pool-names]
               optionally filter by name
   
   
   $ bin/nodetool help setconcurrency 
   NAME
           nodetool setconcurrency - Set maximum concurrency for processing stage
   
   SYNOPSIS
           nodetool [(-h <host> | --host <host>)] [(-p <port> | --port <port>)]
                   [(-pp | --print-port)] [(-pw <password> | --password <password>)]
                   [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
                   [(-u <username> | --username <username>)] setconcurrency [--]
                   <pool-name> <maximum-concurrency> | <pool-name> <core-pool>
                   <maximum-concurrency>
   
   OPTIONS
           -h <host>, --host <host>
               Node hostname or ip address
   
           -p <port>, --port <port>
               Remote jmx agent port number
   
           -pp, --print-port
               Operate in 4.0 mode with hosts disambiguated by port number
   
           -pw <password>, --password <password>
               Remote jmx agent password
   
           -pwf <passwordFilePath>, --password-file <passwordFilePath>
               Path to the JMX password file
   
           -u <username>, --username <username>
               Remote jmx agent username
   
           --
               This option can be used to separate command-line options from the
               list of argument, (useful when arguments might be mistaken for
               command-line options
   
           <pool-name> <maximum-concurrency> | <pool-name> <core-pool>
           <maximum-concurrency>
               Set concurrency for processing stage
   ```
   
   usage examples
   
   ```
   $ bin/nodetool getconcurrency
   Pool Name                    CorePoolSize MaximumPoolSize
   AntiEntropyStage                        1               1
   CounterMutationStage                    0              32
   GossipStage                             1               1
   ImmediateStage                          0               0
   InternalResponseStage                  12              12
   MigrationStage                          1               1
   MiscStage                               1               1
   MutationStage                           0              32
   ReadStage                               0              32
   RequestResponseStage                    0              12
   TracingStage                            1               1
   ViewMutationStage                       0              32
   $ bin/nodetool getconcurrency read mutation
   Pool Name                    CorePoolSize MaximumPoolSize
   MutationStage                           0              32
   ReadStage                               0              32
   $ bin/nodetool setconcurrency read 16
   $ bin/nodetool getconcurrency read mutation
   Pool Name                    CorePoolSize MaximumPoolSize
   MutationStage                           0              32
   ReadStage                               0              16
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message