cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weijun Li" <>
Subject RE: Cassandra benchmark shows OK throughput but high read latency (> 100ms)?
Date Tue, 16 Feb 2010 07:53:46 GMT
It seems that read latency is sensitive to number of threads (or thrift
clients): after reducing number of threads to 15 and read latency decreased
to ~20ms. 

The other problem is: if I keep mixed write and read (e.g, 8 write threads
plus 7 read threads) against the 2-nodes cluster continuously, the read
latency will go up gradually (along with the size of Cassandra data file),
and at the end it will become ~40ms (up from ~20ms) even with only 15
threads. During this process the data file grew from 1.6GB to over 3GB even
if I kept writing the same key/values to Cassandra. It seems that Cassandra
keeps appending to sstable data files and will only clean up them during
node cleanup or compact (please correct me if this is incorrect). 
Here's my test settings:

JVM xmx: 6GB
KCF: 0.3
Memtable: 512MB.
Number of records: 1 millon (payload is 1000 bytes)

I used JMX and iostat to watch the cluster but can't find any clue for the
increasing read latency issue: JVM memory, GC, CPU usage, tpstats and io
saturation all seem to be clean. One exception is that the wait time in
iostat goes up quickly once a while but is a small number for most of the
time. Another thing I noticed is that JVM doesn't use more than 1GB of
memory (out of the 6GB I specified for JVM) even if I set KCF to 0.3 and
increased memtable size to 512MB.

Did I miss anything here? How can I diagnose this kind of increasing read
latency issue? Is there any performance tuning guide available?


-----Original Message-----
From: Jonathan Ellis [] 
Sent: Sunday, February 14, 2010 6:22 PM
Subject: Re: Cassandra benchmark shows OK throughput but high read latency
(> 100ms)?

are you i/o bound?  what is your on-disk data set size?  what does
iostats tell you?

do you have a lot of pending compactions?  (tpstats will tell you)

have you increased KeysCachedFraction?

On Sun, Feb 14, 2010 at 8:18 PM, Weijun Li <> wrote:
> Hello,
> I saw some Cassandra benchmark reports mentioning read latency that is
> than 50ms or even 30ms. But my benchmark with 0.5 doesn't seem to support
> that. Here's my settings:
> Nodes: 2 machines. 2x2.5GHZ Xeon Quad Core (thus 8 cores), 8GB RAM
> ReplicationFactor=2 Partitioner=Random
> JVM Xmx: 4GB
> Memory table size: 512MB (haven't figured out how to enable binary
> so I set both memtable number to 512mb)
> Flushing threads: 2-4
> Payload: ~1000 bytes, 3 columns in one CF.
> Read/write time measure: get startTime right before each Java thrift call,
> transport objects are pre-created upon creation of each thread.
> The result shows that total write throughput is around 2000/sec (for 2
> in the cluster) which is not bad, and read throughput is just around
> 750/sec. However for each thread the average read latency is more than
> 100ms. I'm running 100 threads for the testing and each thread randomly
> a node for thrift call. So the read/sec of each thread is just around 7.5,
> meaning duration of each thrift call is 1000/7.5=133ms. Without
> the cluster write throughput is around 3300/s, and read throughput is
> 1400/s, so the read latency is still around 70ms without replication.
> Is there anything wrong in my benchmark test? How can I achieve a
> read latency (< 30ms)?
> Thanks,
> -Weijun

View raw message