Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Ruby on Rails / Speeding up Heroku Deploys

Speeding up Heroku Deploys

February 6, 2014 by Rob Bazinet Leave a Comment

Tweet

Anyone who deploys their Rails 3.x or 4.x utilizing the asset pipeline and doesn?t precompile those assets yet deploys to Heroku, knows it can take a really long time for your deployment.

I searched around a bit and found a great article on how to shave some time off my Heroku deployments. ?Alex MacCaw has a nice write up about the process:

If you?re using Heroku, the first step is enabling a Memcache addon. I?ve gone with the?memcachier?service, as they?ve got a generous free plan (which is all we need at this stage).

heroku addons:add memcachier:dev

Then we need to make sure the environmental variables are available to your app during the pre-compilation stage. Usually this isn?t the case on Heroku, but they?ve got a new labs feature called?user-env-compile?which will do the trick.

heroku labs:enable user-env-compile

Next you?ll need to add the?dalli?and?memcachier?gems to your Gemfile. Finally, the last step is to configure Sprockets.

Since I am using Rails:

With Rails

With Rails, just configure the assets cache store inconfig/environments/production.rb.

config.assets.cache_store =:dalli_store

And the time savings would be?.

?An example of time saving with a relatively small project:

Not using the speed-up method, deploy time:?2 minutes 40 seconds

Using the above method:?47 seconds

It is definitely worth the little effort.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Related

Filed Under: Ruby on Rails Tagged With: deployment, heroku, Ruby on Rails

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Recent Posts

  • Social Media Times Are Changing
  • It has certainly been a long time…
  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Everything I read these days mentions ChatGPT or AI as the answer to everything. So many red flags. I hate trends l… https://t.co/ITLxsfAvd9
    about 1 week ago
  • If anyone knows any projects looking for some dev help, mainly Rails, as a lead who can manage small teams…I’d love… https://t.co/u0ClZ8x5wB
    about 3 weeks ago
  • This is such the truth…Even Amazon can't make sense of serverless or microservices https://t.co/0zK9YVMdrj
    about 4 weeks ago
  • I’m not sure I’d subscribe to content on Twitter when I already follow someone. Maybe I’m missing something.
    about 4 weeks ago
  • This looks really cool and a great real world use of AI. https://t.co/DzX5BbgDdY
    about 1 month ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon