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
Puma memory usage #1063
Comments
Oddly those line numbers don't match up but I agree, there are some large Hashes in const that can be cleaned up. Let me see about moving where it's required as well. |
Awesome. Testing the results now. Before:
|
DAAAAAAMN, SON. Making me look bad! After:
|
Seems like I need to move my APIs to autoload to minimize the memory overhead of unused features. |
Glad to know that will help sidekiq processes!
|
For apps that need the constants loaded, moving to autoload can increase memory since it's no longer taking advantage of CoW. |
It's only autoloaded by puma.rb. All other usages will load everything as
|
Great! Thanks for the patch! 🚀👏 |
@evanphx could we get a link to the relevant pull request or commit to see what you changed? Trying to learn something today! |
I was auditing a trivial Rails 5.0.0 app using https://github.com/schneems/derailed_benchmarks#use and noticed that Puma 3.6.0 seems to grab a lot of memory on startup - not a ton but just enough to be at the top. The main offender seems to be the large number of constants in
puma/const
. Could some of these constants be lazy loaded in server mode only (i.e. not when requiring 'puma')?Full gist: https://gist.github.com/mperham/399f0ed0eca321aeaf9ee20cf104a849
The text was updated successfully, but these errors were encountered: