-
Notifications
You must be signed in to change notification settings - Fork 623
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
default connect timeouts are too low #1701
Comments
Hi @tarzanek , thank you for the suggestion and sorry for the delayed reply. Aligning the default values with the Cassandra defaults sounds good to me. These are Cassandra 4.1 defaults:
Here is a survey of some other clients:
It seems it might be worth opening tickets there as well. Regarding gocql, it seems to me that we should set both connect timeout and request timeout to slightly more than 10 seconds, because range requests have default timeout 10s in Cassandra. Truncate requests are not that often and 60s seems excessive. What was the reason you suggested Timeout lower than ConnectTimeout in the original post? Is it that multiple requests need to happen during session initialization? |
so my suggestion was based on assumption that connect timeout is the first contact - which should be 10s default |
It'd be great to move forward with this. We've had a use case which used the default and really hit the poor node hard - with more clients trying to reconnect way too fast due to the low timeout. Should we send a PR fixing the default connect timeout value to higher value? |
Client timeouts need to be higher than server timeouts, so that work does not accumulate on the server with retries. This was not true by default, the gocql default timeout was lower than the Cassandra default timeout. Closes apache#1671 Closes apache#1701
Client timeouts need to be higher than server timeouts, so that work does not accumulate on the server with retries. This was not true by default, the gocql default timeout was lower than the Cassandra default timeout. Closes apache#1671 Closes apache#1701
default cassandra timeouts are usually
5s for reads or 10s for other operations
while https://github.com/gocql/gocql/blob/master/cluster.go#L54 defaults in go are
600ms for both above
As you all know, client timeouts should be bigger than server ones, otherwise a reconnect storm or request retry storm might happen.
Could you increase default timeouts above (Timeout and ConnectTimeout ) to be above server side defaults ?
e.g. 6s for Timeout and 11s for ConnectTimeout
While at the same topic the default retry policy is also a bit hardcore (I think 3x retry per 1s), wouldn't it make sense to change it to some backoff policy? (but that said, main focus of this issue should be default timeouts, please)
The text was updated successfully, but these errors were encountered: