Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon ec2 Cassandra在查询超过10000行的密钥时超时,即使超时10秒_Amazon Ec2_Cassandra_Cql3_Datastax_Ttl - Fatal编程技术网

Amazon ec2 Cassandra在查询超过10000行的密钥时超时,即使超时10秒

Amazon ec2 Cassandra在查询超过10000行的密钥时超时,即使超时10秒,amazon-ec2,cassandra,cql3,datastax,ttl,Amazon Ec2,Cassandra,Cql3,Datastax,Ttl,Im使用带有预安装默认设置的DataStax社区v 2.1.2-1(AMI v 2.5)。 我有一张桌子: CREATE TABLE notificationstore.note ( user_id text, real_time timestamp, insert_time timeuuid, read boolean, PRIMARY KEY (user_id, real_time, insert_time)) WITH CLUSTERING ORDER BY (real

Im使用带有预安装默认设置的DataStax社区v 2.1.2-1(AMI v 2.5)。 我有一张桌子:

CREATE TABLE notificationstore.note (
  user_id text,
  real_time timestamp,
  insert_time timeuuid,
  read boolean,
  PRIMARY KEY (user_id, real_time, insert_time))
WITH CLUSTERING ORDER BY (real_time DESC, insert_time ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}
AND **default_time_to_live** = 20160
其他配置包括:

我有两个节点。在m3.L上,具有1 x 32(SSD)。 我面临着超时的问题,即使在这个特定的表上一致性设置为1

  • 我将堆空间增加到3gb[内存大小为8gb]
  • 我将读取超时时间增加到10秒。
    从注释中选择计数(*),其中用户id='xxx'限制2;//错误={},最后一个主机=127.0.0.1。
  • 我想知道问题是否与时间有关?或者是否有任何其他配置或任何与此相关的调整

    数据库中的数据非常小
    此外,此问题不会在插入后立即发生。这会在一段时间后发生(超过6小时)


    谢谢。

    [从这里复制我的答案,因为它是相同的环境/问题:。]

    您遇到了一个问题,即逻辑删除的数量(已删除的值)超过阈值,然后超时

    如果启用跟踪,然后尝试select语句,则可以看到这一点,例如:

    cqlsh> tracing on;
    cqlsh> select count(*) from test.simple;
    
     activity                                                                        | timestamp    | source       | source_elapsed
    ---------------------------------------------------------------------------------+--------------+--------------+----------------
    ...snip...
     Scanned over 100000 tombstones; query aborted (see tombstone_failure_threshold) | 23:36:59,324 |  172.31.0.85 |         123932
                                                        Scanned 1 rows and matched 1 | 23:36:59,325 |  172.31.0.85 |         124575
                               Timed out; received 0 of 1 responses for range 2 of 4 | 23:37:09,200 | 172.31.13.33 |       10002216
    
    对于Cassandra来说,您遇到了一种反模式,数据在被删除之前只存储了一小段时间。有几个选项可以更好地处理这个问题,包括在需要时重新访问数据模型。以下是一些资源:

    • -参见墓碑设置部分

    对于您的示例问题,我尝试将
    gc\u grace\u seconds
    设置降低到300(5分钟)。这会导致清理墓碑的频率比默认的10天更高,但这可能会根据您的应用程序而有所不同。仔细阅读删除的含义,您可以根据应用程序的需要进行调整

    请参考此问题。。。我已经将超时设置为10秒,并在两个节点上重新启动了cassandra。不走运。即使有,我想如果我的表不是很大的话,查询10秒的时间也太长了。@mehnaazm我想这和我的答案是一样的。为了完整起见,我可以把答案复制到这里吗?@BrianC,是的,这解决了问题