如何优化类似Cassandra队列的列系列? [英] How can I optimize a Cassandra queue-like column family?

查看:90
本文介绍了如何优化类似Cassandra队列的列系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似队列的列系列,它大约每小时更新一次。几个小时或一天后,cassandra的读取时间很多。

I have a queue-like column family which updates frequently around every hour. After a couple of hours or a day cassandra has a lot of read time outs.

我已经尝试过了,但是还没有得到结果:gc_grace_seconds = 0并使用LeveledCompaction。

I have tried this but haven't gotten the result yet: gc_grace_seconds = 0 and using LeveledCompaction.

还是您会建议使用datetieredcompactionstrategy还是这两个方法还有更好的策略?

Or would you recommend the datetieredcompactionstrategy or is there another better strategy then these two?

如果无法解决此问题,我想切换到另一个数据库,您认为这是否必要吗?

If I cannot solve this I am thinking switching to another database do you think that is necessary?

感谢您的回复。

推荐答案

您所做的是反模式并具有

那是说您真的想控制您的墓碑,因为越来越多的原因引起了人们的注意。 GC问题并增加读取延迟(必须从磁盘读取大量数据以读取空队列)。由于默认的 tombstone_compaction_interval ,您可能没有从gc_grace设置为0受益。

That said you really want to keep your tombstones under control, as you get more and more cause a lot of GC issues and increase read latencies (has to read a lot of data off disk to read the empty queue). You are probably not getting the benefit of your gc_grace setting of zero due to the default tombstone_compaction_interval.

我建议您可以更新紧凑策略以帮助:

I would suggest you update your compaction strategy to help:

ALTER TABLE footable WITH
  compaction = {'class': 'LeveledCompactionStrategy', 
    'sstable_size_in_mb': '256mb',
    'tombstone_compaction_interval': '1',
    'unchecked_tombstone_compaction': 'true',
    'tombstone_threshold': '0.05'} AND 
  gc_grace_seconds = 0

请记住,更积极地删除墓碑会导致删除丢失。确实,如果可能的话,您应该考虑更新应用程序以使用更合适的东西。

Keep in mind that more aggressive tombstone removal creates a possibility for a delete to be "lost". Really, if possible, you should look into updating your application to use something more suitable.

这篇关于如何优化类似Cassandra队列的列系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆