Is it possible to disable compaction?

369 views
Skip to first unread message

Hua Jiang

<5451vs5451@gmail.com>
unread,
Aug 9, 2017, 1:15:56 AM8/9/17
to ScyllaDB users
I created the table with compaction = { 'class': 'LeveledCompactionStrategy', 'enabled': false }, but it doesn't seem to work. Compaction I/O queue activity is still spotted at high level while loading data into scylla.

cqlsh> desc ycsb;

CREATE KEYSPACE ycsb WITH replication
= {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

CREATE TABLE ycsb
.k64 (
    y_id text PRIMARY KEY
,
    field0 text
) WITH bloom_filter_fp_chance = 0.01
    AND caching
= '{"keys":"ALL","rows_per_partition":"ALL"}'
    AND comment
= ''
    AND compaction
= {'enabled': 'false', 'class': 'LeveledCompactionStrategy'}
    AND compression
= {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance
= 0.1
    AND default_time_to_live
= 0
    AND gc_grace_seconds
= 864000
    AND max_index_interval
= 2048
    AND memtable_flush_period_in_ms
= 0
    AND min_index_interval
= 128
    AND read_repair_chance
= 0.0
    AND speculative_retry
= '99.0PERCENTILE';

Raphael S. Carvalho

<raphaelsc@scylladb.com>
unread,
Aug 9, 2017, 1:32:03 AM8/9/17
to scylladb-users@googlegroups.com
On Wed, Aug 9, 2017 at 2:15 AM, Hua Jiang <5451v...@gmail.com> wrote:
> I created the table with compaction = { 'class':
> 'LeveledCompactionStrategy', 'enabled': false }, but it doesn't seem to
> work. Compaction I/O queue activity is still spotted at high level while
> loading data into scylla.

Hi,

enabled option isn't supported yet, but compaction can be disabled by
setting class to NullCompactionStrategy.

>
> cqlsh> desc ycsb;
>
> CREATE KEYSPACE ycsb WITH replication = {'class': 'SimpleStrategy',
> 'replication_factor': '1'} AND durable_writes = true;
>
> CREATE TABLE ycsb.k64 (
> y_id text PRIMARY KEY,
> field0 text
> ) WITH bloom_filter_fp_chance = 0.01
> AND caching = '{"keys":"ALL","rows_per_partition":"ALL"}'
> AND comment = ''
> AND compaction = {'enabled': 'false', 'class':
> 'LeveledCompactionStrategy'}
> AND compression = {'sstable_compression':
> 'org.apache.cassandra.io.compress.LZ4Compressor'}
> AND dclocal_read_repair_chance = 0.1
> AND default_time_to_live = 0
> AND gc_grace_seconds = 864000
> AND max_index_interval = 2048
> AND memtable_flush_period_in_ms = 0
> AND min_index_interval = 128
> AND read_repair_chance = 0.0
> AND speculative_retry = '99.0PERCENTILE';
>
> --
> You received this message because you are subscribed to the Google Groups
> "ScyllaDB users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scylladb-user...@googlegroups.com.
> To post to this group, send email to scyllad...@googlegroups.com.
> Visit this group at https://groups.google.com/group/scylladb-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/scylladb-users/3bb43d9e-f733-42b1-9fae-297f907ecbb5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Hua Jiang

<5451vs5451@gmail.com>
unread,
Aug 9, 2017, 3:37:42 AM8/9/17
to ScyllaDB users
Thanks, Raphael. Another question, how can I remove stale sstables if compaction is disabled? Our database is generated as a whole at midnight every day, and will not be updated until the next day.

Raphael S. Carvalho

<raphaelsc@scylladb.com>
unread,
Aug 9, 2017, 11:32:34 AM8/9/17
to scylladb-users@googlegroups.com
On Wed, Aug 9, 2017 at 4:37 AM, Hua Jiang <5451v...@gmail.com> wrote:
> Thanks, Raphael. Another question, how can I remove stale sstables if
> compaction is disabled? Our database is generated as a whole at midnight
> every day, and will not be updated until the next day.

If you want to keep background compaction disabled, the only way I see
it is 'nodetool compact'. That will compact all existing sstables
together, getting rid of all stale data.
> https://groups.google.com/d/msgid/scylladb-users/d0b9a2b4-2a6b-4b21-bc7b-58047740c0bf%40googlegroups.com.

Hua Jiang

<5451vs5451@gmail.com>
unread,
Aug 9, 2017, 9:50:31 PM8/9/17
to ScyllaDB users
I see. And we're going to commit a 'nodetool drain' before 'nodetool compact' to avoid impaction on read latency caused by compaction, and restart the node to join the cluster again. Is it a common practice for cassandra / scylla? And can I apply the same trick on a heavily updated cluster?
Reply all
Reply to author
Forward
0 new messages