Skip to content

PER-10765: Use SQS fair queueing - #842

Draft
cecilia-donnelly wants to merge 1 commit into
mainfrom
per-10765-fair-queuing
Draft

PER-10765: Use SQS fair queueing#842
cecilia-donnelly wants to merge 1 commit into
mainfrom
per-10765-fair-queuing

Conversation

@cecilia-donnelly

Copy link
Copy Markdown
Member

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.

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
cecilia-donnelly marked this pull request as draft August 20, 2026 17:29
@cecilia-donnelly

Copy link
Copy Markdown
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."

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.

1 participant