Skip to content

nix: add new loadtest for errors#4576

Merged
steve-chavez merged 5 commits intoPostgREST:mainfrom
steve-chavez:loadtest-errors
Dec 23, 2025
Merged

nix: add new loadtest for errors#4576
steve-chavez merged 5 commits intoPostgREST:mainfrom
steve-chavez:loadtest-errors

Conversation

@steve-chavez
Copy link
Member

@steve-chavez steve-chavez commented Dec 22, 2025

Adds a new loadtest that includes only requests that produces errors (misspelled relations, misspelled functions, permission errors).

Tries to repro #4462

@steve-chavez steve-chavez force-pushed the loadtest-errors branch 2 times, most recently from ac46d8f to 4940996 Compare December 22, 2025 19:23
@steve-chavez
Copy link
Member Author

So far this proves that the rate of error processing is much lower than normal successful requests.
Rate of errors is ~67 vs and mixed is 468, this while using much more CPU, ~100% on errors vs ~20% on mixed.
See https://github.com/PostgREST/postgrest/actions/runs/20441827293?pr=4576#summary-58736347815.

OOMs of #4462 are not reproduced, this looks only dependent of the number of tables, not the number of continued requests.

@steve-chavez
Copy link
Member Author

Later on we can add more types of errors for this load test: https://docs.postgrest.org/en/v14/references/errors.html#postgrest-error-codes. We should ensure error processing stays fast for every case.

@steve-chavez steve-chavez marked this pull request as ready for review December 22, 2025 20:38
@steve-chavez steve-chavez force-pushed the loadtest-errors branch 3 times, most recently from c92eb61 to 9cbe208 Compare December 23, 2025 02:41
@steve-chavez
Copy link
Member Author

This CI job proves there's considerable memory consumed when the table/function count is 30K. Unfortunately that number is causing a CI coverage failure which I don't understand. So I'll leave the table/function count at 950.

@steve-chavez
Copy link
Member Author

Unfortunately that number is causing a CI coverage failure which I don't understand.

And looks like this coverage failure persist even after reducing the table count. The error reported on CI doesn't reveal anything and locally it cannot be reproduced.

@steve-chavez steve-chavez force-pushed the loadtest-errors branch 2 times, most recently from 4005db4 to 4c6c7be Compare December 23, 2025 19:12
Also included it in CI.
@steve-chavez
Copy link
Member Author

Added 20K tables now and left adding many functions as TODO (this was somehow making the loadtest slow). This now proves the memory consumption is high for the fuzzy search, I've also added a sleep for 5 seconds so it ensures the high memory consumption doesn't come from the schema cache.

@steve-chavez steve-chavez merged commit b8ca1bb into PostgREST:main Dec 23, 2025
33 checks passed
Comment on lines +430 to +432
if [[ -n "$_arg_sleep" ]]; then
sleep "$_arg_sleep"
fi
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this argument has a default of 0, so the condition will always be true. Should work to just call sleep all the time - with 0 as argument if the default is used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 76e0e1f, just removed the default instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants