Including rails_admin from git increases heroku slug size by 37mb #1083

maxwell opened this Issue Apr 15, 2012 · 5 comments


None yet
3 participants

maxwell commented Apr 15, 2012

While this is deployment specific, I thought it would be worth noting.

Including rails_admin radically increases the size of the slug on cloud services like Heorku (which have a hard limit at 100mb)

Since the rest of Diaspora in it's entirety is about 57mg (with WAAAAAy more dependencies), I am thinking there might be some runaway thing that is getting bundled in that is huge.

Worth noting, I did try a simple hack, which was to purge the git history, ( which according to my contributor @stevenh512 brought the slug size down 10mb, and means that there is about 17mg of stuff still in rails_admin which would be there if you packaged a gem tomorrow.

see here for more info: diaspora/diaspora@ecc1a84#commitcomment-1211283


sferik commented Apr 15, 2012

Hey Max. You're not the first person to ask for this. I'll take care of it soon.

It would be nice if bundler gave you a way to make a shallow clone: carlhuda/bundler#228

maxwell commented Apr 15, 2012


Thanks for responding. I look forward to a packaged gem, and hopefully getting to the bottom of what is causing the bloat.

I will give a me too on that bundler issue as well.


stevenh512 commented Apr 16, 2012

@maxwell I think part of the size issue (even using your rails_admin_smaller repo) is the fact that there's always some git history, even if it's only one commit. There are also screenshots in the repo that I hope wouldn't be included in a packaged gem, but that's probably only a small part of the problem. 😁

I think it's interesting that when I clone your rails_admin_smaller repo, git tells me I've downloaded less than 2mb (I think it was 1.7 or 1.8), but it still adds 17mb to my slug size.. makes me wonder if there might also be something wrong on Heroku's end. I don't see anything in the rails_admin gemspec that would account for an extra 15mb+ slug size (especially since we're already depending on many of those same gems).

After looking at carlhuda/bundler#228 I'm not sure if it would be possible to do a shallow clone and still satisfy Bundler's Gemfile.lock, but I'm wondering if it might be possible to do something (either in Bundler or in Heroku's slug compiler) to get rid of the git history for a production deploy. I have recent copies of Bundler and Heroku's Ruby buildpack here so I might try experimenting with that and see what I can come up with.

sferik closed this in e12f8b4 Apr 16, 2012


sferik commented Apr 16, 2012

Your wish is my command.


stevenh512 commented Apr 17, 2012

Nice.. thanks @sferik this should reduce my Heroku slug size quite a bit (without the buildpack hack I'm currently using) 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment