Build Rails app for production environment #10
Merged
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.
Description
In our Soak Tests, we found out that a Rails app instrumented with OTel Ruby in
development
mode will use an unbounded amount of memory when receiving several requests.CloudWatch showed a
development
Rails app using 11 GB of memory after just 2 hours:We asked on the OTel Ruby CNCF Slack channel and got the great feedback that we should use a
production
environment.This PR does that, and when we did that the Memory Usage was less than 1 GB after 5 hours:
However, to allow for a
production
environment, the rails app requires a "secret_base_key". Otherwise it will spam the log output with warnings which is really troublesome.To solve this, we added dummy credentials which don't do anything. Because this is an example, we directly commit the security credentials in the Dockerfile but this is NOT GOOD PRACTICE FOR REAL PRODUCTION ENVIRONMENTS. We allow it to be like this because we want this demo example to work.
You can confirm the credentials work and view the encoded contents of by doing the following command:
This will show the following contents:
We cannot use something like
RAILS_MASTER_KEY=BOGUS_KEY
but the tests immediately fail to start the app 😕: