-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(billing): add consumer list cache to UCAN stream consumer (#406)
This adds an LRU cache to the UCAN stream consumer for billing to allow us to process data for spaces with frequent writes a lot quicker (will also reduce our dynamo reads bill a little). Previously we filtered lambda invocations items to only process receipts (instead of also invocations, which we simply dropped). This was working for 3 days but now iterator age has started increasing again. <img width="412" alt="Screenshot 2024-07-15 at 11 26 53" src="https://github.com/user-attachments/assets/6e5ec767-c874-4dad-b3de-ba7cceee3c9c"> The lambda simply reads from the consumer table and writes to the space diff table. The data from the consumer table almost never changes (it actually cannot right now - we haven't built this feature yet) so an in-memory cache should speed up execution for spaces with high write frequency. We're currently seeing runtimes of ~250ms (when we actually need to do some work - i.e. a lot of lambda invocations are not doing any space diff accounting because they are for receipts that are not for `store/add` or `blob/add`): <img width="391" alt="Screenshot 2024-07-15 at 11 29 58" src="https://github.com/user-attachments/assets/ce737752-de5d-4541-bacc-7620a349c8ce">
- Loading branch information
Showing
4 changed files
with
54 additions
and
6 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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