For example, I was working on something yesterday and doing deploys to the staging environment. I noticed that it took forever to be able to start serving requests. Passenger-status showed all three instances were running, and were all stuck serving their first request. A little digging revealed that there were a bunch of node.js processes running compiling assets! What the?! I thought I was precompiling everything! Nope, apparently not.
After a little digging, I found this setting:
config.assets.compile = true
Set that to
false and redeployed, and all of a sudden, I was seeing 500
responses for assets that weren’t precompiled! I ended up
config.assets.precompile list and eventually the app started up fine and
I got rid of the unpleasant “first request takes forever” symptom in
I think this is most likely going to bite you if you use a gem that provides its own assets and doesn’t add them to the precompile list on its own (which it should).
I hope that helps someone avoid some downtime / slow requests in the future, because it took me a while to figure out!