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

Decrease tick interval to 20 ms. #1269

Closed
wants to merge 3 commits into from
Closed

Decrease tick interval to 20 ms. #1269

wants to merge 3 commits into from

Conversation

srh
Copy link

@srh srh commented Jul 27, 2017

Note that etcd does 5 ms, and Cockroach does 200 ms by default. Note that Cockroach has complicated usage of the library so things there might not be so simple. I went with 20 ms because that's low enough to make us catch up a replica on the same order of time that an initial series of writes happened, on a particular piece of hardware with a particular usage pattern.

Connected to #1180.


This change is Reviewable

Sam Hughes added 2 commits July 27, 2017 15:09
This is a stop-gap.  For whatever reason, we aren't replaying log
entries any faster than one entry per tick.  This makes replaying the
log be about 15x slower than loading the data initially cost (when
running locally on a decent laptop).  So, reducing the tick interval
by a factor of 20 seems like it'll suffice, for that hardware.
@srh
Copy link
Author

srh commented Jul 27, 2017

Edited the comments, which I should have looked at.


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@manishrjain
Copy link
Contributor

:lgtm: @janardhan1993 just checked. The pings within Amazon DC are under a millisecond (200 micros). So, we should be good on that account as well.


Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks broke.


worker/draft.go, line 242 at r2 (raw file):

		cfg: &raft.Config{
			ID: id,
			// 200 ms if we call Tick() every 20 ms.

The comments can fit in the same line as the code.


worker/draft.go, line 244 at r2 (raw file):

			// 200 ms if we call Tick() every 20 ms.
			ElectionTick: 10,
			// 20 ms if we call Tick() every 20 ms.

and here.


Comments from Reviewable

@srh
Copy link
Author

srh commented Jul 28, 2017

In master as of f1ac05e

@srh srh closed this Jul 28, 2017
@srh srh deleted the sam/tickrate branch July 28, 2017 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants