On Wed, Dec 19, 2012 at 4:20 PM, Hiller, Dean <dean.hil...@nrel.gov> wrote:
> What????? I thought cassandra was using nio so thread per connection is not 
> true?

Here's the monkey test I used to verify my conjecture.

1) ps -eLf |grep jsvc |grep cassandra | wc -l # note number of threads
2) for name in {1..300}; do  cassandra-cli -h `hostname` -k validkeyspace & done
3) ps -eLf |grep jsvc | grep cassandra | wc -l # note much higher
number of threads
4) for name in {1..300}; do kill "%$name" done
5) ps -eLf |grep jsvc | grep cassandra | wc -l # note that thread
count drops like a rock as connections are GCed

Via aaron_morton, here's the relevant chunk of cassandra.yaml :

https://github.com/apache/cassandra/blob/trunk/conf/cassandra.yaml#L347
"
# sync  -> One thread per thrift connection.
..
# hsha  -> Stands for "half synchronous, half asynchronous."
..
# The default is sync because on Windows hsha is about 30% slower.  On Linux,
# sync/hsha performance is about the same, with hsha of course using
less memory.
"

So, by default Cassandra does in fact use one thread per thrift connection.

=Rob

-- 
=Robert Coli
AIM&GTALK - rc...@palominodb.com
YAHOO - rcoli.palominob
SKYPE - rcoli_palominodb

Reply via email to