Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiling on staging/production takes too long/is too slow #1003
I got my webpacker to start compiling my scss and everything works great on local. But when I try to deploy through Heroku, when it gets to the compiling portion of webpack, it takes more than 300 seconds to compile and because of that it will then time out and stop the deployment.
here is some of the output in my deploy logs:
One solution might be to increase the timeout time from 300s to something larger, but I would first like to see if there might be some bad configuration on my part that might be causing the compiling to take too long.
I am using webpacker 3.0.2, I am locked at this commit:
@ajnassar It could be a memory issue, since Webpack generally uses more memory if there are more assets to compile. Perhaps, bump up the instance type on Heroku and see if that helps or compile the assets locally (
Ya increasing the memory didn't help. I increased it from 1gb to 2.5 and still couldn't get under teh timeout.
Just a sidenote though, although I don't think it solves the obvious problem here, I solved the 300 second timeout issue. I am using shipit to deploy and it has a default inactivity timout of 300 seconds. I changed it to 900 seconds (15 minutes) and it was able to go past the process.
But I think the major problem here is different, so maybe I should open up a different issue, but I was doing some testing and when I run assets:precompile, my webpack compiles in 53 seconds but when I deploy through shipit which gets released on heroku, it takes ~6:30.
So the time difference is huge! Maybe it could be a thing were we through more hardware at the problem, but I am not sure how webpacker handles all the compilation. Are there any ways I can speed this up?