Skip to content
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

150Mb more memory used with node 8.10.0 than 10.13.0 #830

Closed
teeparham opened this issue Nov 21, 2018 · 5 comments
Closed

150Mb more memory used with node 8.10.0 than 10.13.0 #830

teeparham opened this issue Nov 21, 2018 · 5 comments

Comments

@teeparham
Copy link

The memory usage for a single Hobby dyno rails web app was 150Mb higher without the heroku/nodejs buildpack.

A) with heroku/nodejs

Memory: 350Mb

Buildpacks:

1. https://github.com/gaffneyc/heroku-buildpack-jemalloc.git
2. https://github.com/cyberdelia/heroku-geo-buildpack.git
3. heroku/nodejs # <-----------------------------------------
4. heroku/ruby

Deploy log:

remote:        Downloading and installing node 10.13.0...

B) without heroku/nodejs

Memory: 500Mb

Buildpacks:

1. https://github.com/gaffneyc/heroku-buildpack-jemalloc.git
2. https://github.com/cyberdelia/heroku-geo-buildpack.git
3. heroku/ruby

Deploy log:

remote: -----> Installing node-v8.10.0-linux-x64

screen shot 2018-11-21 at 10 58 04 am

The rails app uses:

  * execjs (2.7.0)
  * sprockets (3.7.2)
  * sprockets-rails (3.2.1)
@elaine-jackson
Copy link

What optimizations / differences are in the nodejs build back that could be added to the Ruby build pack for it's Node.js support?

@schneems schneems changed the title 150Mb more memory used with node 8 150Mb more memory used with node 10.13.0 than 8.10.0 Dec 11, 2018
@schneems
Copy link
Contributor

Can you please open a support ticket so we can look at your app? https://help.heroku.com search for "node higher memory use". Are you using node at runtime in your ruby app?

cc/ @jmorrell

@schneems
Copy link
Contributor

This is relevant since we recently bumped the node version to 10.x on the Ruby buildpack on master, but it hasn't been deployed yet #831

@teeparham
Copy link
Author

The ruby app is not using node at runtime. That's why I tried to remove the node buildpack. Yes, I'll open a ticket.

@teeparham teeparham changed the title 150Mb more memory used with node 10.13.0 than 8.10.0 150Mb more memory used with node 8.10.0 than 10.13.0 Dec 13, 2018
@schneems
Copy link
Contributor

Wanted to mention the ultimate root cause if anyone stumbles upon this thread.

The heroku/nodejs buildpack will set a default value for WEB_CONCURRENCY however the Ruby buildpack will not. So if someone has an app with a line like this in their config:

workers Integer(ENV.fetch("WEB_CONCURRENCY") { 1 })

Then they would expect the default value to be 1 when in reality the value is set by the node buildpack.

This can be resolved by not using the node buildpack or by explicitly setting the WEB_CONCURRENCY value:

$ heroku config:set WEB_CONCURRENCY=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants