mirror of https://github.com/apache/cassandra
Change default for cassandra.set_sep_thread_name to false to reduce CPU usage
Add an extra optimization if it is enabled: invoke Thread.setName only if a phase changed patch by Dmitry Konstantinov; reviewed by Francisco Guerrero, Jyothsna Konisa for CASSANDRA-21089
This commit is contained in:
parent
7b3514d443
commit
32162cf544
|
|
@ -1,4 +1,5 @@
|
|||
6.0-alpha2
|
||||
* Change default for cassandra.set_sep_thread_name to false to reduce CPU usage (CASSANDRA-21089)
|
||||
* Avoid permission checks for masked columns when the table doesn't have any (CASSANDRA-21299)
|
||||
* Reduce allocations and array copies due to buffer resizing in LocalDataResponse during row serialization (CASSANDRA-21285)
|
||||
* Implement a guardrail for client driver versions (CASSANDRA-21146)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ final class SEPWorker extends AtomicReference<SEPWorker.Work> implements Runnabl
|
|||
|
||||
private final AtomicReference<Runnable> currentTask = new AtomicReference<>();
|
||||
|
||||
private String lastUsedExecutorName;
|
||||
|
||||
SEPWorker(ThreadGroup threadGroup, Long workerId, Work initialState, SharedExecutorPool pool)
|
||||
{
|
||||
this.pool = pool;
|
||||
|
|
@ -129,8 +131,11 @@ final class SEPWorker extends AtomicReference<SEPWorker.Work> implements Runnabl
|
|||
assigned = get().assigned;
|
||||
if (assigned == null)
|
||||
continue;
|
||||
if (SET_THREAD_NAME)
|
||||
if (SET_THREAD_NAME && assigned.name != lastUsedExecutorName) // .equals is not used intentionally
|
||||
{
|
||||
Thread.currentThread().setName(assigned.name + workerIdThreadSuffix);
|
||||
lastUsedExecutorName = assigned.name;
|
||||
}
|
||||
|
||||
task = assigned.tasks.poll();
|
||||
currentTask.lazySet(task);
|
||||
|
|
|
|||
|
|
@ -536,7 +536,7 @@ public enum CassandraRelevantProperties
|
|||
*/
|
||||
SEED_COUNT_WARN_THRESHOLD("cassandra.seed_count_warn_threshold"),
|
||||
SERIALIZATION_EMPTY_TYPE_NONEMPTY_BEHAVIOR("cassandra.serialization.emptytype.nonempty_behavior"),
|
||||
SET_SEP_THREAD_NAME("cassandra.set_sep_thread_name", "true"),
|
||||
SET_SEP_THREAD_NAME("cassandra.set_sep_thread_name", "false"),
|
||||
SHUTDOWN_ANNOUNCE_DELAY_IN_MS("cassandra.shutdown_announce_in_ms", "2000"),
|
||||
SIMULATOR_ITERATIONS("simulator.iterations", "3"),
|
||||
SIMULATOR_SEED("cassandra.simulator.seed"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue