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

fix: Reduce sync frequency #1648

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

sanjayprabhu
Copy link
Contributor

@sanjayprabhu sanjayprabhu commented Feb 3, 2024

Motivation

Hubs are under significant load, we're syncing too often. Reducing sync frequency should help.

Will look into switching to probabilistic syncing across different time frames (higher frequency for recent timeframes and lower frequency for longer timeframes).

Change Summary

Describe the changes being made in 1-2 concise sentences.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review

Additional Context

If this is a relatively large or complex change, provide more details here that will help reviewers


PR-Codex overview

This PR reduces the sync frequency of the Hubble app to help reduce the load on the hub.

Detailed summary

  • Reduces the sync frequency from every 2 minutes to every 2 hours in the PeriodicSyncJobScheduler.
  • Temporarily disables sync with new peers in the hubble.ts file.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@sanjayprabhu sanjayprabhu added the t-bug A fix for a bug with the current system label Feb 3, 2024
Copy link

changeset-bot bot commented Feb 3, 2024

🦋 Changeset detected

Latest commit: 6d2aa74

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@farcaster/hubble Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2024 10:07pm

Copy link

codecov bot commented Feb 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (577d698) 73.85% compared to head (6d2aa74) 73.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1648      +/-   ##
==========================================
- Coverage   73.85%   73.78%   -0.07%     
==========================================
  Files          99       99              
  Lines        9010     9007       -3     
  Branches     2001     2000       -1     
==========================================
- Hits         6654     6646       -8     
- Misses       2238     2243       +5     
  Partials      118      118              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// Temporarily disable sync with new peers
log.debug({ peerInfo: message }, "New peer but skipping sync");
// const syncResult = await ResultAsync.fromPromise(
// this.syncEngine.diffSyncIfRequired(this, peerId.toString()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only be syncing the last ~ hour-days worth of messages here. Anything longer should happen in the sync job.

@sanjayprabhu sanjayprabhu merged commit 57ce2c6 into farcasterxyz:main Feb 3, 2024
10 checks passed
@sanjayprabhu sanjayprabhu deleted the reduce_sync_frequency branch February 3, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-bug A fix for a bug with the current system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant