Cleaning up the bundler cache when deploying to heroku

前端 未结 2 1967
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 04:05

Whenever I\'m deploying to Heroku (Ruby on Rails app using the heroku_san gem) it says the following:

Cleaning up the bundler cache.
Would have removed sitem         


        
2条回答
  •  醉话见心
    2020-12-29 04:31

    I also get this on every Heroku app I've ever deployed and have yet to experience problems.

    Here's why I think you don't have to worry about it:

    • Having a bunch of stored gems on their server shouldn't slow down your app. Heck, even if you threw in a bunch of gems you didn't need into your Gemfile, the noticeable performance hits are likely to be to your app's initial launch time and subsequent memory use. And if those gems aren't in your Gemfile, the performance hit to your app should be nil.
    • While Heroku has a soft limit of 100MB for slugs on a free account, my own anecdotal evidence suggests that this does not include gems you've removed from your Gemfile (which makes sense if the wild speculation below is correct).

    And here's wild speculation as to why Heroku isn't cleaning the bundler cache:

    Memory is more expensive than hard drive space, so while most gems might take up a trivial amount of space on a hard drive, they can add up if a ton of gems have to be loaded into memory. However, if a gem isn't in your Gemfile, it won't be in memory. And it's very likely more expensive to remove (and possibly later re-download) a gem than it is to keep it stored on the drive, just in case you later change your mind and want to re-add it to your Gemfile.

提交回复
热议问题