Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

virajut avatar image
virajut asked Erick Ramirez answered

Does Cassandra use a thread per connection or a thread per operation?

I am trying to figure out whether Cassandra uses `threads per connection` or `thread per operation`. I've observed `tpstats` output while workload is running but it is not giving any clear picture about it from the thread-pool. I've seen one process thread active all time when workload is running which is also not helping much to give an idea whether it is per connection base or per operation base.

Is there a utility / parameter or any way to check how threads are spawned, apart from `tpstats`?

cassandra
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Looks like it is using Native-Transport-Requests pool.

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

On the client side, the driver by default opens a single connection to each node in the cluster and sends asynchronous "streams" using the same connection where each request is tagged with a stream ID.

On the server-side, each client request is handled by a thread which maps to Native-Transport-Requests in the nodetool tpstats output as you already discovered. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.