Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize NettyChannel usage #345

Open
dkropachev opened this issue Sep 23, 2024 · 0 comments
Open

Optimize NettyChannel usage #345

dkropachev opened this issue Sep 23, 2024 · 0 comments

Comments

@dkropachev
Copy link
Collaborator

From https://scylladb-users.slack.com/archives/C2NLNBXLN/p1725297082189579?thread_ts=1725284973.161149&cid=C2NLNBXLN

It seems I found the reason. Scylla driver will create connection per shard. It means if you have 3 nodes with 8 CPU it will create 24 connections https://github.com/scylladb/java-driver/blob/scylla-4.x/core/src/main/java/com/datastax/oss/driver/internal/core/pool/ChannelPool.java#L489
The problem here that's scylla driver creating DriverChannels that's are backed to the NettyChannel and every NettyChannel actually a selector loop.
So you'll have 24 while true loops that are constantly working if you always writing data to the scylla.

  1. It leads to very poor client performance, since you have dedicated Selector loop only for one TCP socket. For example, 150k rps using cassandra driver consumes 1 CPU on client side, but using scylla driver consumes 6 CPU.
  2. It's better to specify that "advanced.connection.pool.local.size" configuration behaves different
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant