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

autoset max_old_space_size #34

Closed
adrai opened this issue Oct 15, 2015 · 7 comments
Closed

autoset max_old_space_size #34

adrai opened this issue Oct 15, 2015 · 7 comments

Comments

@adrai
Copy link

adrai commented Oct 15, 2015

Does it make sense for you to automatically set max_old_space_size ?
Is it possible to use the configured memory value (cf scale)?
the reason / use case: https://github.com/nodejs/node/wiki/Frequently-Asked-Questions

@aminjam
Copy link

aminjam commented Oct 15, 2015

Buildpack users should be able to set the --max_old_space_size through the Procfile depending on how much memory is allocated at the runtime.

Procfile

web: node --max_old_space_size=128 server.js

Deploy

cf push app -m 128M

@davidjahn mentioned that you may also be able to retrieve that information dynamically at the start time depending on your version of CF. I believe the newer ones should all have the VCAP_APPLICATION options.

web: node --max_old_space_size=$(echo $VCAP_APPLICATION | jq '.limits.mem') server.js

@adrai
Copy link
Author

adrai commented Oct 16, 2015

thanks for the answer

@adrai adrai closed this as completed Oct 16, 2015
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/105875260.

@afeld
Copy link
Contributor

afeld commented Apr 13, 2016

automatically set max_old_space_size

Is this a pull request y'all would consider? Seems like a nice "smart" thing the buildpack could do for users out of the box.

@flavorjones
Copy link
Contributor

Hey @afeld,

Great to hear from you!

If you wanted to put in the effort to have the nodejs buildpack "do the right thing" and set this value to the size of the application memory limit at runtime, that would be an interesting thing to consider; but I'd also want to see how it behaves in real-world situations.

I think the real answer here is that nobody has been able to explain (other than the barebones FAQ linked to) that this actually works as intended. See related thread from last July:

https://lists.cloudfoundry.org/archives/list/cf-dev@lists.cloudfoundry.org/message/OSI4RD4X2FLE2U44SEWLTD66JHZIBWO4/

@adrai
Copy link
Author

adrai commented May 27, 2016

@CAFxX
Copy link
Contributor

CAFxX commented Mar 31, 2017

Our internal users ran into this today with a 512M memory quota. This should ideally be implemented, but at the very least it should be clearly documented.

@CAFxX CAFxX mentioned this issue Apr 18, 2017
3 tasks
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

6 participants