-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(spool): Improve unspool strategy (#3047)
The recent stats show that when we have a lot of records with only 1 envelope per key, the unspool is very slow, since the service has to go into DB and fetch 1 key at a time, which can block the `Buffer` and by accumulating the messages in the internal queue it can also use up more memory. This change is introducing batching for all the valid keys, which makes sure we can unspool many records at once, which allows us to decrease the number sent message between the services and also read from the disk more data in one go. Make sure we can unspool faster from the buffer: * requests all the envelopes for all the valid projects * batch those requests for all the incoming keys * make sure we return keys back when is over low watermark
- Loading branch information
Showing
3 changed files
with
281 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.