Heroku Slug Size - 237MB. The repo size is 70 MB.

Statistics

Stack: Cedar
Framework: Ruby
Repo Size: 78.3MB
Slug Size: 237MB of 300MB

      

Heroku Support Letter

My Slug Size has increased to 237MB. My repo is only about 75MB in size. I figured the reason was because my assets are being stored multiple times in my slug, taking up unnecessary space.

I pre-compiled my assets for the first time so my images will show up on Heroku. I wanted to reduce the size of the bullet, so I optimized my images. In an effort to reduce load times, I reduced the size of my images. Then I precompiled them. Instead of replacing old images with new ones, my bullet size was holding both sets of images.

I ran heroku run bash to open my application command line. After that I burned a CD to my assets / images directory and ran ls. I found myself on the way

app/assets/images

      

There are 3 sets of images.

and on the way

public/assets/images

      

There are 2 sets of images

This is a huge albatross in my application, and if I could fix it, I could reduce the slip size by at least half. I have tried working in these directories

rmdir Dirname

      

but I cannot delete them because they have files in them.

I am trying to delete unnecessary files that I don't need in the first place. I searched your documentation, but you didn't describe how to remove files from your pool.

I also don't want to lose any data in my application because it took a long time to create this data.

Please come back to me with answers to this question.

END OF LETTER

BOTH this is a huge albatross and it drives me crazy. I tried to work

heroku run bash

      

for command line input for my application

I connected to the apps / assets / images directory and didn't like what I saw. In each subdirectory, I saw three copies of each image. ARGHHHH! And under public / assets / images, I saw two copies of each image.

I want to know if there is a way to remove this albatross because it is just such a waste of my time.

+3


source to share


3 answers


One thing that helps is adding a .slugignore file to the root of your project to tell Heroku not to compile certain files or directories into the pool. Mine looks like this:

*.psd
*.pdf
test
spec
features
doc
public

      



The public entry is there because I serve all static files from the Amazon S3 service; just leave this line off unless you are using an external content delivery system.

+7


source


I may be wrong (and if so, please correct me!), But here's what I did with my assets when there were some changes:

  • Uncheck the existing asset manifest:

    rake assets:clean
    
          

  • Remove all files from the "public \ assets" folder

  • Precompile the production version of the assets:

    RAILS_ENV=production rake assets:precompile 
    
          

  • Then commit and push to Heroku



Thus, you should only get one copy of the assets on Heroku.

+3


source


The bullet size includes the size of the gems you are using:

https://devcenter.heroku.com/articles/slug-compiler#slug-size

I would run a couple of commands $ du

that your gems have ever been set on and try to find the big ones.

http://www.computerhope.com/unix/udu.htm

With that in mind, if you've finished adding gems to your project, it might not matter that you are close to the limit, because 60MB is enough code / image space to work with. If you have many more images to add, you can post them somewhere else.

+1


source







All Articles