New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on staging/production takes too long/is too slow #1003

Closed
ajnassar opened this Issue Nov 8, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@ajnassar

ajnassar commented Nov 8, 2017

Hello,

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:
Webpacker is installed 🎉 🍰
remote: Using /tmp/build_b83402624cdf4cb178d00ff61c4dd481/config/webpacker.yml file for setting up webpack paths
remote: Compiling…
remote: No output received in the last 300 seconds.

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:
b47f7dd

Any thoughts?

@gauravtiwari

This comment has been minimized.

Show comment
Hide comment
@gauravtiwari

gauravtiwari Nov 9, 2017

Collaborator

@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 (NODE_ENV=production bundle exec rails assets:compile) and then deploy.

Collaborator

gauravtiwari commented Nov 9, 2017

@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 (NODE_ENV=production bundle exec rails assets:compile) and then deploy.

@ajnassar

This comment has been minimized.

Show comment
Hide comment
@ajnassar

ajnassar Nov 10, 2017

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?

ajnassar commented Nov 10, 2017

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?

@gauravtiwari

This comment has been minimized.

Show comment
Hide comment
@gauravtiwari

gauravtiwari Nov 11, 2017

Collaborator

@ajnassar Probably because in production you are also minifying assets and generating sourcemaps. What type of sourcemap are you generating - default one that ships with Webpacker?

Collaborator

gauravtiwari commented Nov 11, 2017

@ajnassar Probably because in production you are also minifying assets and generating sourcemaps. What type of sourcemap are you generating - default one that ships with Webpacker?

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