Repository navigation
Fit the Render demo into the free plan's memory - #51
Merged
Merged
Conversation
Render sets WEB_CONCURRENCY=1, which put Puma in cluster mode, and Solid Queue forked four more processes. Together they used about 650 MB, over the free plan's 512 MB, and the deploy timed out. The demo now runs Puma in single mode with Solid Queue as threads (new SOLID_QUEUE_MODE=async), about 120 MB in one process.
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.
The first Render deploy built fine but timed out on startup with no app output.
Reproducing Render's settings locally showed the cause. Render sets
WEB_CONCURRENCY=1, which puts Puma in cluster mode, and Solid Queue forks a supervisor, dispatcher, worker and scheduler. That's six Ruby processes using about 650 MB, but the free plan has 512 MB.Fix
config/puma.rb: newSOLID_QUEUE_MODE=asyncoption that runs Solid Queue as threads inside Puma, using Solid Queue's built-in async mode.render.yaml: setsWEB_CONCURRENCY=0(Puma single mode) andSOLID_QUEUE_MODE=async.Nothing changes for the Docker image or other deploys unless they set these variables.
Checks
/upreturned 200 within a few seconds, and the dispatcher, worker and scheduler (includingreset_demo) all started.bin/rails test: 136 runs, 0 failures. Rubocop is clean.