-
Notifications
You must be signed in to change notification settings - Fork 820
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
How to choose the right intervals for the "Keep Alive" and "Heartbeat" features #178
Comments
Hi. Choice of keepAliveInterval/heartbeatInterval depends on how fast you want broken connection to be detected & restored, network latency, etc. Think about keepAliveInterval as Regarding the docs: you are absolutely right. I should have mentioned HEARTBEAT events a long time ago. Thank you for pointing it out! |
Hi, Yes, your explanation makes perfect sense. Thanks again, |
(keeping this ticket open until readme is updated) |
Hi,
We're looking to use this project within JRuby to detect changes in MySQL. We have a proof-of-concept up and running using
BinaryLogClient#connect
. Based on the available documentation (i.e. https://github.com/shyiko/mysql-binlog-connector-java/blob/master/readme.md), we expected this method to block indefinitely, however we've found that it returns (i.e. stops blocking) after a certain period of time. After going back to the documentation again and not finding any answers, we stumbled across #102, which led us to #118 and ultimately to a84200e#diff-7addc4e3eed6e9254e088abc015ac8adR393.We've now configured BinaryLogClient via
setKeepAliveInterval
andsetHeartbeatInterval
, and that seems to have solved the problem withBinaryLogClient#connect
returning. We're using 60,000 milliseconds for the keep alive interval, and 10,000 milliseconds for the heartbeat interval, however, we have no real basis for choosing those numbers. 60,000 milliseconds appears to be the default keep alive interval, and 10,000 milliseconds was chosen as the heartbeat interval to ensure that we're using a value less than the keep alive interval.What consideration/criteria goes into choosing the proper intervals for those settings? Are there general rule-of-thumb values we should be using? What characteristics of an application would cause someone to fine tune those settings?
Also, I know we would've been saved some time had the documentation mentioned the "Keep Alive" and "Heartbeat" features when talking about
BinaryLogClient
. Perhaps just adding a blurb about each feature to https://github.com/shyiko/mysql-binlog-connector-java#tapping-into-mysql-replication-stream would save other newbies some time.Thanks for all your hard work on this project.
Best regards,
Denis
The text was updated successfully, but these errors were encountered: