Skip to content

Fix: Send the SSM batches in parallel - #17

Merged
mnapoli merged 2 commits into
brefphp:mainfrom
felipehertzer:parallel-batches
Nov 11, 2026
Merged

mnapoli merged 2 commits into
brefphp:mainfrom
felipehertzer:parallel-batches

Conversation

@felipehertzer

@felipehertzer felipehertzer commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Hi,

When there is more than 10 bref-ssm: variables the loader split them in batches of 10 (the api limit), but it read the result of each batch before create the next one. So the requests go one after the other and the cold start wait for every round trip.

async-aws send the request when the result is created, so now it create all the batches first and read them after. On our app (11 secrets) loading them went from ~130 ms to ~109 ms.

async-aws also throw a failure that nobody read when the result is destructed, so it read every result even when one fail, and throw the first error at the end (same clear message for the 400 as before).

added two tests: one check both requests are sent before any response is read (with a MockHttpClient), the other that when every batch fail it still give the permissions message.

Thanks.

with more than 10 `bref-ssm:` variables the loader call `getParameters` once per 10
names, but it read each result before send the next batch, so the batches go one
after the other and the cold start wait for every round trip.

async-aws send the request when the result is created, so now all the batches are
created first and read after.

async-aws also throw a failure nobody read when the result is destructed, so every
result is read even after one fail, and the first error is thrown after (same
message for the 400 as before).
@felipehertzer felipehertzer changed the title send the ssm batches in parallel Fix: Send the SSM batches in parallel Nov 6, 2026

@mnapoli mnapoli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it's good to merge, can you fix the CI?

@felipehertzer

Copy link
Copy Markdown
Contributor Author

Hey @mnapoli, it should be fixed now. Thanks.

@mnapoli
mnapoli merged commit 1b4f9a6 into brefphp:main Nov 11, 2026
8 checks passed
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