gaffneyc / heroku-buildpack-jemalloc

Heroku buildpack that installs the Jemalloc memory allocator
BSD 3-Clause "New" or "Revised" License
252 stars 77 forks source link

suggest or provide a MALLOC_CONF #33

Closed jjb closed 3 months ago

jjb commented 1 year ago

Thanks for a great project!

Have you considered providing, or at least suggesting, a MALLOC_CONF?

This might be a good choice - it's used by https://github.com/fly-apps/dockerfile-rails/ which will likely be in rails 7.1

MALLOC_CONF="dirty_decay_ms:1000,narenas:2,background_thread:true"

more info:

https://gist.github.com/jjb/9ff0d3f622c8bbe904fe7a82e35152fc

gaffneyc commented 1 year ago

Thanks!

I don't think setting a default value makes sense for two reasons. The buildpack is used by languages other than Ruby (I believe Python and Node may benefit from it as well) and the defaults may not apply to them. Secondly, changing the default risks breaking someone's app in a way that would be difficult to debug. I've spent enough time on those kinds of hunts to never want to inflict it on anyone else.

Documenting it and providing a recommended default would be useful with a rationale for the recommendation.