将数据保存到 cassandra 时,70% 的保存性能大约需要 4-8 毫秒。但是 30% 的请求大约需要 80-90 毫秒。所以试图弄清楚为什么有些请求需要很长时间。我怀疑这些请求可能会跨越数据中心,但无法确认。
此外,当使用 astyanax 时,我们将固定到 localhost,这将有助于连接到本地 cassandra 协调器。此处使用的主键是生成的 UUID。
如果有人可以帮助解决这个问题,我将不胜感激。
Write Consistency: CL_ONE
Read Consistency: CL_LOCAL_QUORUM
using Astyanax for java client: 1.56.37
Cassandra version: 1.2.5
这是键空间信息:
CREATE KEYSPACE grd WITH replication = {
'class': 'NetworkTopologyStrategy',
'HYWRCA02': '2',
'CHRLNCUN': '2'
};
CREATE TABLE route (
routeid uuid PRIMARY KEY,
allowdynamicstickyness boolean,
businesskey uuid,
createdby text,
createdtimestamp timestamp,
datapartitionkeyselectorref text,
deletedby text,
deletedtimestamp timestamp,
envcontext text,
lockedbyuser text,
partner text,
routelocationlatitudeselector double,
routelocationlongitudeselector double,
routelocationmaxdistanceselector double,
routename text,
sequence int,
serviceidentifier text,
stalenessinmins int,
status text,
stickykeyselector text,
tags set<text>,
type text,
updatedby text,
updatedtimestamp timestamp,
versionmapnameref text,
versionselector text
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='ALL' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'LeveledCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};
谢谢。