Hello all,

I've recently upgraded to Cassandra 4.1 and see a change in compaction behavior 
that seems unwanted:

* With Cassandra 3.11 compaction was run by thread in low priority and thus 
using CPU nice (visible using top) (I believe Cassandra 4.0 also had this 

* With Cassandra 4.1, compactions are no longer run as low priority thread 
(compaction now use "normal" CPU).

This means that when the server had limited CPU, Cassandra compaction now 
compete for the CPU with other process (probably including Cassandra itself) 
that need CPU. When it was using CPU nice, the compaction only competed for CPU 
with other lower priority process which was great as it leaves CPU available 
for processes that need to kept small response time (like an API used by human).

Is it wanted to lose this feature in Cassandra 4.1 or was it just a forget 
during re-write of compaction executor ? Should I open a bug to re-introduce 
this feature in Cassandra ?

I've done few searches, and:

* I believe compaction used CPU nice because the compactor executor was created 
with minimal priority: 

* I think it was dropped by commit 

* It looks doable to set the thread priority with new executor, I think adding 
".withThreadPriority(Thread.MIN_PRIORITY)" when using executorFactory in 
 should do it.

Did I miss a reason to no longer use low priority threads for compaction ? 
Should I open a bug for re-adding this feature / submit a PR ?


Pierre Fersing

Reply via email to