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

Replication limiter #15

Closed
wants to merge 16 commits into from
Closed

Replication limiter #15

wants to merge 16 commits into from

Conversation

pietgeursen
Copy link

@pietgeursen pietgeursen commented Oct 8, 2018

Motivation:

manyverse needs the ability to limit the number or peers being replicated to improve performance of the app. This PR integrates the ssb-replication-limiter module I've written to help solve that problem.

Changes in this PR:

  • adds a helper function getPeerAheadBy that the limiter can use to find out how far ahead a remote peer's feed is. The limiter uses this value to decide whether or not to change modes.
  • change the request method from ebt.request (feedId, enableReplication) to ebt.request (feedId, enableReplication, [priority]) so the limiter can prioritise who to replicate first. See this PR for the changes to ssb-friends.
  • adds and passes CI tests.
  • exports the request function from the module. This wasn't done previously, I assume this was a bug because currently we're hooking the sbot.request function and it hasn't been needed.
  • exposes methods to dynamically configure the limiter's threshold and maxNumConnections.
  • uses config to set initial values for threshold and maxNumConnections

Using request(<feedId>, **false**) to pause replication.

Dominic said that using request like this might cause problems with eventual consistency. See this issue for more context.

Until ebt has a better pause feature I'm hoping we can use request like this.

adds repl manager as dep.

Integrate dominic's changes.

Add latest commit number for rep manager

trying

mess with logging.

adds more logging

so painful

dkfjdsaflkjfdslkjfdsalk

Maybe?

dfk

remove logging

use latest rep manager.

pass priority to replication manager

use latest rep manager.
@mmckegg
Copy link
Contributor

mmckegg commented Dec 5, 2018

About to start using this branch in Patchwork. I'll let ya'll know how it goes.

mmckegg added a commit to ssbc/patchwork that referenced this pull request Dec 5, 2018
@mmckegg mmckegg force-pushed the replication-manager branch from 01dd1b9 to 739ba54 Compare December 24, 2018 00:12
@mmckegg
Copy link
Contributor

mmckegg commented Dec 24, 2018

sorry @pietgeursen, made a bit of a mess of the commit history trying to get master merged in (and the merge conflicts properly resolved).

@stale
Copy link

stale bot commented Mar 24, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@christianbundy
Copy link
Contributor

Anything I can do to help this along, or are you waiting from feedback from @staltz and @dominictarr?

@stale stale bot removed the stale label Nov 19, 2019
@staltz
Copy link
Member

staltz commented Nov 21, 2019

I think this is part of a project that was cancelled, so I'm not sure that this code in this state is currently reflecting a fully functional code state that we want to include into master branch. I'm inclined to archiving this PR for future reference once we resume this work.

@christianbundy
Copy link
Contributor

Cool, I would love to merge these improvements but if the PR isn't going to get merged then I'd prefer to just close it. I'm going to close both this and ssbc/ssb-friends#11, please re-open and/or ping me if I've done something rude/wrong.

❤️

@dominictarr
Copy link
Contributor

if I recall correctly, this was intended to fix a problem with cpu usage, or slow syncing, but once it was ready it turned out it wasn't the problem - the problem was indexing.

@staltz staltz deleted the replication-manager branch May 31, 2021 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants