开发者

Cassandra issue when counting millions of columns

开发者 https://www.devze.com 2023-04-12 06:13 出处:网络
I was inserting columns to row, and by cassandra-cli checking qty of them: [default@CassandraExample] count admins[ascii(\'0\')];

I was inserting columns to row, and by cassandra-cli checking qty of them:

[default@CassandraExample] count admins[ascii('0')]; 492506 columns [default@CassandraExample] count admins[ascii('0')]; 531375 columns [default@CassandraExample] count admi开发者_开发知识库ns[ascii('0')]; 556985 columns [default@CassandraExample] count admins[ascii('0')]; 615568 columns [default@CassandraExample] count admins[ascii('0')]; 740790 columns [default@CassandraExample] count admins[ascii('0')]; 794993 columns [default@CassandraExample] count admins[ascii('0')]; 1008291 columns [default@CassandraExample] count admins[ascii('0')]; 1080951 columns [default@CassandraExample] count admins[ascii('0')]; null

and as you can see, later count printed null and now it prints null all the time(when I want to count admins[0]). I tried to resize max heap size to 1500M(I cant give more I don't know why(Java prints error)), and configure other options, but still it doesn't work.

What is possible cause of such situation?


I'm going to make a lot of educated guesses here:

  • you're running a 32bit java, which is why you can't allocate more memory to its heap
  • you're getting an error in Cassandra's system log
  • you're not running Cassandra 1.0, which pages large count requests internally (https://issues.apache.org/jira/browse/CASSANDRA-3068)

So my recommendations would be:

  • Upgrade to 1.0 if you insist on doing huge counts, but
  • Huge counts are never going to be fast, so consider using a denormalized counter instead
  • If you want to continue troubleshooting your old version, paste the exception from Cassandra's system.log and enable the debug switch on the cli
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号