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
Precompilation & Load Path Cache #355
Comments
I think I didn't add it because that cache is dependent on the But if you have some ideas or rough patches, feel free to submit them. |
Another thing to note is that Lambda is a read-only file system. My method to build the RUN bundle exec bootsnap precompile --gemfile app/ lib/ && \
LAMBY_BUILD=1 bundle exec ruby app.rb Where However, one big hurdle I had to overcome is that this file is opened and re-written on boot. I've done some general testing and it appears to not change. Can you share why this file is mutated and ends up unless ENV['LAMBY_BUILD']
require 'bootsnap'
Bootsnap::LoadPathCache::Store.class_eval do
def commit_transaction ; end
end
end |
That's pretty much what we do too. Mostly to run
Hum, that sounds weird. I'd have to dig that up. Not sure I'll have the time today though. Does your app ever mutate |
Thanks. No, the application does not mutate |
Maybe you happen to have a backtrace relating to that? |
Yup!
|
Hum, I'm afraid I'm not able to reproduce. On my test app the cache is consistent and isn't marked as dirty on subsequent boots. If you are able to reproduce this in isolation I'm interested in digging this up, but at this stage I'm afraid this issue isn't actionable for me. |
Would a different
If not, where else could I look to reproduce this? |
Yes. The content of |
I meant a new entry will be written. |
Thanks! Would you be open to a configuration change to avoid writing the new entry? |
I'd be open to a patch that would ignore the error. That would be inline with recent changes in bootsnap where we make the cache best effort. |
Thanks. Done deal. #358 |
I think this was fixed. |
I am working on optimizing some cold starts for Rails in AWS Lambda (https://lamby.custominktech.com) and wonder if you could describe why the precompilation command does not also add the
load-path-cache
. My goal is to have this in place for the Docker image deployed to Lambda so Rails boots faster.I've come up with a workaround to do just that. But hoping y'all can add some context as to how the load path cache is supposed to work.
The text was updated successfully, but these errors were encountered: