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

Is there an option for shard aware? #70

Closed
pveentjer opened this issue Aug 13, 2021 · 9 comments · Fixed by #71
Closed

Is there an option for shard aware? #70

pveentjer opened this issue Aug 13, 2021 · 9 comments · Fixed by #71
Labels

Comments

@pveentjer
Copy link

pveentjer commented Aug 13, 2021

I was wondering why the throughput numbers were so low compared to cassandra-stress (from Scylla) and the number of connections is way lower. So by default scylla-bench isn't shard aware, it doesn't open a connection to every shard and route traffic to the right shard.

@pveentjer pveentjer changed the title Is there an option shard aware? Is there an option for shard aware? Aug 13, 2021
@piodul
Copy link
Contributor

piodul commented Aug 13, 2021

Which host selection policy are you using (the host-selection-policy option)? Shard-awareness should work only with the default option, which is token-aware. In that case, the gocql driver should open exactly one connection for each shard and will ignore the connection-count parameter. See here for more details.

@pveentjer
Copy link
Author

pveentjer commented Aug 16, 2021

I'm using default.

The number of connections is not correctly determined with default settings and with explicit

go/bin/scylla-bench -workload uniform -mode read -partition-count 10000000 -nodes 172.31.10.9 -concurrency 1600 -duration 10m -clustering-row-count 1 -host-selection-policy=token-aware 2>&1 | tee -a scylla-bench-16-08-2021_11-21-07.log

The number of shard is 92. And I only see connections for the first 23 shards. So in total there are 23 connections even though there should be 92.

I'm using the scylla-bench master branch.

@pveentjer pveentjer added the bug label Aug 16, 2021
@piodul
Copy link
Contributor

piodul commented Aug 16, 2021

How did you install scylla-bench? Like this?

go install github.com/scylladb/scylla-bench

I just checked and this version indeed is not shard-aware. However, if you build scylla-bench from source it should be shard-aware:

git clone https://github.com/scylladb/scylla-bench
cd scylla-bench/
go install .

Please check if the version built from source works better.

@pveentjer
Copy link
Author

pveentjer commented Aug 16, 2021

I'm using the first approach.

When using '-host-selection-policy=token-aware' the connection count setting is not ignored btw. I set it to 92 and every shard has multiple connections (it seems 3 or 4 per shard).

I'll try out the other approach now.

@piodul
Copy link
Contributor

piodul commented Aug 16, 2021

I'm using the first approach.

When using '-host-selection-policy=token-aware' the connection count setting is not ignored btw. I set it to 92 and every shard has multiple connections (it seems 3 or 4 per shard).

I'm not exactly sure what is happening here, but I suspect that go install builds scylla-bench using the original gocql/gocql driver, not the scylladb/gocql fork. Only the scylladb/gocql fork supports shard-awareness, gocql/gocql does not.

@pveentjer
Copy link
Author

pveentjer commented Aug 16, 2021

It seems like a bug :) Let me verify first with the custom build approach if shard aware works properly.

@pveentjer
Copy link
Author

pveentjer commented Aug 16, 2021

I see there are just a few cross shard operations. So it seems to be shard aware.

@piodul
Copy link
Contributor

piodul commented Aug 17, 2021

I did some digging and it seems that my theory about go install not using our fork is correct. We are using a replace directive to substitute our fork in place of the upstream (which is a recommended practice according to our fork's readme). However, commands like go get and go install do not honor the replace directive - it is expected behavior: golang/go#30354 - which resulted in you accidentally using the non-shard-aware driver.

I don't think this issue should be classified as a bug in scylla-bench, because the problem was caused by the combination of go tool's idiosyncrasies and the way our fork is supposed to be substituted. However, the proper way to install scylla-bench should be documented in the readme - now, the recommended way is go get, which is not what we want! I'll send a PR with an improved instruction.

@pveentjer
Copy link
Author

If you can update the documentation for installing, then I'm fine with closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants