Cap auction list page size to stop OOM kills - #1630
Open
OlegPhenomenon wants to merge 3 commits into
Open
OlegPhenomenon wants to merge 3 commits into
OlegPhenomenon wants to merge 3 commits into
Conversation
show_all=true set the pagy limit to the full result count, so one request rendered every active auction. A row costs ~266KB of transient objects (~2970 allocations), measured in staging: 13MB for 50 rows, ~260MB for 1000. With a 450Mi container limit and puma running 5 threads, clicking "show all" and then sorting killed the process (exit 137, OOMKilled) and the ingress answered 503. per_page was also unbounded and crashed with 500 on non-numeric input, because params[:per_page] is a String and String#zero? does not exist. Clamp both paths to MAX_PAGE_LIMIT and fall back to the default page size for junk input. This also drops the duplicate COUNT query that the controller ran before pagy did its own.
bundler-audit flagged rubyzip 3.1.0 (path traversal, GHSA-47m2-wp7j-p9vc, fixed in 3.4.0). It is a transitive dependency of selenium-webdriver (rubyzip >= 1.2.2, < 4.0), so only the lockfile entry changes.
|
Contributor
🚀 Deploy Complete!
(Environment ready for testing) |
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.



show_all=true set the pagy limit to the full result count, so one request rendered every active auction. A row costs ~266KB of transient objects (~2970 allocations), measured in staging: 13MB for 50 rows, ~260MB for 1000. With a 450Mi container limit and puma running 5 threads, clicking "show all" and then sorting killed the process (exit 137, OOMKilled) and the ingress answered 503.
per_page was also unbounded and crashed with 500 on non-numeric input, because params[:per_page] is a String and String#zero? does not exist.
Clamp both paths to MAX_PAGE_LIMIT and fall back to the default page size for junk input. This also drops the duplicate COUNT query that the controller ran before pagy did its own.