How to debug a Rails asset precompile which is unbearably slow

后端 未结 3 1175
遥遥无期
遥遥无期 2021-01-30 13:09

I\'m working on a Rails 3.2 project and the assets have increased a fair bit in recent months although I wouldn\'t consider the project to be large. The assets consist of JS (no

3条回答
  •  既然无缘
    2021-01-30 13:55

    I think you need to see the cpu usage parameters on your Prod server.

    Moreover, there may be a possibility that assets are getting precompiled multiple times. I would suggest creating a assets directory in shared directory created by capistrano, copying your changes in the same and link it to your apps while deploying.

    Heres how I do it,

      after "deploy:update_code" do
        run "export RAILS_ENV=production"
        run "ln -nfs #{shared_path}/public/assets #{release_path}/public/assets"
        # Also for logs and temp section.
        # run "ln -nfs #{shared_path}/log #{release_path}/log"
        # run "ln -nfs #{shared_path}/tmp #{release_path}/tmp"
        #sudo "chmod -R 0777 #{release_path}/tmp/"
        #sudo "chmod -R 0777 #{release_path}/log/"
      end
    

提交回复
热议问题