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 redis data size, exclude UTXOs data from job return value #168

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

ahonn
Copy link
Collaborator

@ahonn ahonn commented Jun 11, 2024

We have observed that the bull:utxo-syncer-queue:events key data size in Redis is quite large due to the saving of UTXOs in the sync job return value.

This PR is aimed at reducing the Redis data size by removing the job return value from the UTXO sync and RGB++ collect jobs. Additionally, we are introducing some queue options when enqueuing a job to ensure that the job will be removed after it completes or fails.

We can safely remove the UTXOs data from the job return value because the UTXOs data cache is saved in the DataCache.

Some Facts

  • By default, the BullMQ queue stream has a maximum approximated length of 10000 (https://api.docs.bullmq.io/interfaces/v5.QueueOptions.html#streams)
  • Based on testing, the size of an event is approximately 4 KB. So the size of 10,000 events is about 40 MB.
  • Partners have reported that the data size of bull:utxo-syncer-queue:events in Redis has reached as high as 1.4 GB. (The UTXOs stored in the job's return value cause this behavior.)

Copy link

vercel bot commented Jun 11, 2024

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

Name Status Preview Comments Updated (UTC)
btc-assets-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 6:12am

@ahonn ahonn changed the title fix: reduce redis data size fix: reduce redis data size, exclude UTXOs data from job return value Jun 11, 2024
@Flouse Flouse requested review from Flouse and ShookLyngs June 11, 2024 09:03
@ahonn ahonn requested review from Flouse and removed request for Flouse June 11, 2024 09:08
@Flouse Flouse merged commit 5065bb8 into develop Jun 11, 2024
4 checks passed
@Flouse Flouse deleted the fix/reduce-redis-data-size branch June 11, 2024 10:14
@Flouse Flouse mentioned this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants