PER-10765: Use SQS fair queueing - #842
Draft
cecilia-donnelly wants to merge 1 commit into
Draft
Conversation
SQS now offers "fair queueing" (see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html). This means that we can group messages into different tenants, in this case by uploader (account subject, so an individual human, not an archive). Then: "When a tenant has a disproportionately large number of in-flight messages compared to others, Amazon SQS identifies that tenant as a noisy neighbor and prioritizes message delivery for other tenants. This approach reduces the dwell time impact to the other tenants." So, if Person A is uploading a thousand files, Person B doesn't have to wait for their one file. This will do nothing by itself because right now our backup isn't in SQS but instead inside Archivematica, but there's another change coming to fix that! Note also that I don't know if we'll ever use `backfill-ledger` again, but we may want to have that `admin` tenant for other purposes in the future and I don't think it will hurt anything.
cecilia-donnelly
marked this pull request as draft
August 20, 2026 17:29
Member
Author
|
This will also not work for us currently because we aren't processing enough concurrent work: "For the concurrency share measure to work effectively, your consumers need to process enough messages concurrently that one tenant's share of in-flight messages can stand out. Take this into account when sizing your consumer fleet." |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SQS now offers "fair queueing" (see
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html). This means that we can group messages into different tenants, in this case by uploader (account subject, so an individual human, not an archive). Then: "When a tenant has a disproportionately large number of in-flight messages compared to others, Amazon SQS identifies that tenant as a noisy neighbor and prioritizes message delivery for other tenants. This approach reduces the dwell time impact to the other tenants."
So, if Person A is uploading a thousand files, Person B doesn't have to wait for their one file.
This will do nothing by itself because right now our backup isn't in SQS but instead inside Archivematica, but there's another change coming to fix that!
Note also that I don't know if we'll ever use
backfill-ledgeragain, but we may want to have thatadmintenant for other purposes in the future and I don't think it will hurt anything.