Skip to content

test: memory consumption on big arrays #3968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
steve-chavez opened this issue Mar 24, 2025 · 1 comment
Open

test: memory consumption on big arrays #3968

steve-chavez opened this issue Mar 24, 2025 · 1 comment

Comments

@steve-chavez
Copy link
Member

~500MB. This caused PostgREST to hit the OOM killer at ~12GB.

That is unexpected, we have these tests:

jsonKeyTest "1M" "POST" "/rpc/leak?columns=blob" "27M"
jsonKeyTest "1M" "POST" "/leak?columns=blob" "21M"
jsonKeyTest "1M" "PATCH" "/leak?id=eq.1&columns=blob" "21M"
jsonKeyTest "10M" "POST" "/rpc/leak?columns=blob" "32M"
jsonKeyTest "10M" "POST" "/leak?columns=blob" "32M"
jsonKeyTest "10M" "PATCH" "/leak?id=eq.1&columns=blob" "32M"
jsonKeyTest "50M" "POST" "/rpc/leak?columns=blob" "72M"
jsonKeyTest "50M" "POST" "/leak?columns=blob" "72M"
jsonKeyTest "50M" "PATCH" "/leak?id=eq.1&columns=blob" "72M"
postJsonArrayTest "1000" "/perf_articles?columns=id,body" "20M"
postJsonArrayTest "10000" "/perf_articles?columns=id,body" "20M"
postJsonArrayTest "100000" "/perf_articles?columns=id,body" "24M"

So that means a 50MB JSON should consume at most 72 MB RAM and so on. I thought the memory consumed decreased as the payload size increased.

Maybe we need to do similar tests with different MB sizes of arrays, instead of just one big json object (which is what we do on jsonKeyTest).

Originally posted by @steve-chavez in #3954

@steve-chavez
Copy link
Member Author

Maybe try to lower the memory usage upper bound of PATCH requests, see https://github.com/PostgREST/postgrest/pull/4023/files#r2051465105

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

No branches or pull requests

2 participants