cassandra读取查询在不同的GCP[INIA和GCP US]中花费时间



我们正在从GCP美国地区迁移到GCP印度地区。我们在INDIA中创建了3个节点的集群,在GCP US中有3个节点集群。在将一些读取查询传输到GCP INDIA时,我们面临着在GCP US15毫秒以下运行的同一查询的高读取响应延迟(30毫秒(。

GCP美国(API(-->从->GCP Cassandra(美国(-->需要10-15毫秒。

但印度GCP地区的流量相同

印度GCP(API(--->读自GCP Cassandra(印度(->需要30毫秒。

使用local_quorum检查读取查询跟踪计划时;

---------------------------------------------------------------------------------------------------+----------------------------+
          Execute CQL3 query | 2021-07-13 11:39:26.806000 |
to_serv,eto_glusr_pref_loc FROM glusr_usr WHERE glusr_usr_id =12530; [Native-Transport-Requests-3] | 2021-07-13 11:39:26.807000 |
Preparing statement [Native-Transport-Requests-3] | 2021-07-13 11:39:26.808000 |
reading digest from /XX.XX.XX.XX [Native-Transport-Requests-3] | 2021-07-13 11:39:26.809000 | 
Row cache miss [ReadStage-2] | 2021-07-13 11:39:26.809000 |
Row cache miss [ReadStage-2] | 2021-07-13 11:39:26.811000 | XX
Partition index with 0 entries found for sstable 139241 [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Row cache miss [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Executing single-partition query on glusr_usr [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Executing single-partition query on glusr_usr [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Acquiring sstable references [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Acquiring sstable references [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Skipped 0/13 non-slice-intersecting sstables, included 0 due to tombstones [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Skipped 0/13 non-slice-intersecting sstables, included 0 due to tombstones [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Partition index with 0 entries found for sstable 138332 [ReadStage-2] | 2021-07-13 11:39:26.811000 |
Partition index with 0 entries found for sstable 138620 [ReadStage-2] | 2021-07-13 11:39:26.813000 |
Partition index with 0 entries found for sstable 138331 [ReadStage-2] | 2021-07-13 11:39:26.815000 |
Partition index with 0 entries found for sstable 139240 [ReadStage-2] | 2021-07-13 11:39:26.815000 |
Partition index with 0 entries found for sstable 138783 [ReadStage-2] | 2021-07-13 11:39:26.817000 |
Partition index with 0 entries found for sstable 139719 [ReadStage-2] | 2021-07-13 11:39:26.817000 |
Partition index with 0 entries found for sstable 138621 [ReadStage-2] | 2021-07-13 11:39:26.817000 |
Partition index with 0 entries found for sstable 139855 [ReadStage-2] | 2021-07-13 11:39:26.819000 |
Partition index with 0 entries found for sstable 138950 [ReadStage-2] | 2021-07-13 11:39:26.820000 |
Partition index with 0 entries found for sstable 139096 [ReadStage-2] | 2021-07-13 11:39:26.820000 |
Bloom filter allows skipping sstable 139878 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 140774 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 139883 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 140789 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 139888 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 140794 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 139893 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Partition index with 0 entries found for sstable 140831 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 141000 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Bloom filter allows skipping sstable 141037 [ReadStage-2] | 2021-07-13 11:39:26.821000 |
Caching 1 rows [ReadStage-2] | 2021-07-13 11:39:26.821001 |
Partition index with 0 entries found for sstable 139987 [ReadStage-2] | 2021-07-13 11:39:26.822000 |
Merged data from memtables and 5 sstables [ReadStage-2] | 2021-07-13 11:39:26.822000 |
Bloom filter allows skipping sstable 140052 [ReadStage-2] | 2021-07-13 11:39:26.822000 |
Bloom filter allows skipping sstable 140097 [ReadStage-2] | 2021-07-13 11:39:26.822000 |
Bloom filter allows skipping sstable 140134 [ReadStage-2] | 2021-07-13 11:39:26.822001 |
Bloom filter allows skipping sstable 140135 [ReadStage-2] | 2021-07-13 11:39:26.822001 |
Caching 1 rows [ReadStage-2] | 2021-07-13 11:39:26.822001 |
Merged data from memtables and 5 sstables [ReadStage-2] | 2021-07-13 11:39:26.823000 |
Read 1 live rows and 0 tombstone cells [ReadStage-2] | 2021-07-13 11:39:26.823000 |
Partition index with 0 entries found for sstable 140137 [ReadStage-2] | 2021-07-13 11:39:26.823000 |
Read 1 live rows and 0 tombstone cells [ReadStage-2] | 2021-07-13 11:39:26.823000 |
Enqueuing response to /XX.XX.XX.XX [ReadStage-2] | 2021-07-13 11:39:26.823000 | 
Sending REQUEST_RESPONSE message to /XX.XX.XX.XX [MessagingService-Outgoing-/XX.XX.XX.XX-Large] | 2021-07-13 11:39:26.824000 | X
REQUEST_RESPONSE message received from /XX.XX.XX.XX [MessagingService-Incoming-/XX.XX.XX.XX] | 2021-07-13 11:39:26.825000 | X
Bloom filter allows skipping sstable 140140 [ReadStage-2] | 2021-07-13 11:39:26.825000 |
Processing response from /XX.XX.XX.XX [RequestResponseStage-2] | 2021-07-13 11:39:26.825000 | 

我的节点工具信息

Key Cache              : entries 52837, size 5.21 MiB, capacity 500 MiB, 14109 hits, 49400 requests, 0.286 recent hit rate, 14400 save period in seconds
Row Cache              : entries 232, size 20.91 MiB, capacity 4.09 GiB, 78 hits, 540 requests, 0.144 recent hit rate, 0 save period in seconds

因此,我的问题是如何减少这30毫秒的延迟,以及为什么会发生这种情况。

请告诉我,谢谢。

从第一眼看,我会说您有太多的SST表,您要花费近12毫秒在其中查找数据。我建议使用nodetool tablehistograms检查两个DC中读取的SST表的数量。

但根据追踪,只花了19毫秒就返回了答案。如果您看到30ms的响应时间,那么您可能需要从驱动程序端捕获执行度量,并确保您有从驱动程序到Cassandra节点的快速链接。

最新更新