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

Adjust Puma default config to use a minimum of 1 thread, instead of 5 #24227

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
6 participants
@trevorturk
Contributor

trevorturk commented Mar 17, 2016

Re @schneems default Puma config introduced in 5563c32, this change would lower the default minimum thread count from 5 to 1 and also introduce a new ENV variable to make this easy to adjust without editing the config file.

I found the config file a bit confusing and wondered why it was using the same value for the minimum and maximum thread count. It appears that Puma automatically scales the number of threads (https://github.com/puma/puma#thread-pool) and in the interest of keeping memory usage low on VPS servers etc, I thought it may be smart to default to a lower thread count so that people are more likely to be happy with the default config.

I also tweaked the inline documentation to clarify what was going on.

I'm new to Puma, so forgive me if I'm misunderstanding something. Thank you!

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Mar 17, 2016

r? @eileencodes

(@rails-bot has picked a reviewer for you, use r? to override)

r? @eileencodes

(@rails-bot has picked a reviewer for you, use r? to override)

@eileencodes

This comment has been minimized.

Show comment
Hide comment
Member

eileencodes commented Mar 17, 2016

@trevorturk

This comment has been minimized.

Show comment
Hide comment
@trevorturk

trevorturk Mar 17, 2016

Contributor

😁 👋

Contributor

trevorturk commented Mar 17, 2016

😁 👋

@matthewd

This comment has been minimized.

Show comment
Hide comment
@matthewd

matthewd Mar 17, 2016

Member

Threads really aren't that expensive 😕

Member

matthewd commented Mar 17, 2016

Threads really aren't that expensive 😕

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 17, 2016

Member

I don't think there is a benefit to running in production with fewer than max threads it just moves thread spawn time from boot time to request time which is not ideal.

You can always modify your local file. This is a sensible starting point not a perfect config for every app.

Member

schneems commented Mar 17, 2016

I don't think there is a benefit to running in production with fewer than max threads it just moves thread spawn time from boot time to request time which is not ideal.

You can always modify your local file. This is a sensible starting point not a perfect config for every app.

@trevorturk

This comment has been minimized.

Show comment
Hide comment
@trevorturk

trevorturk Mar 17, 2016

Contributor

Ok, thanks for looking!

Contributor

trevorturk commented Mar 17, 2016

Ok, thanks for looking!

@trevorturk trevorturk closed this Mar 17, 2016

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 17, 2016

Member

in my experience unless you set a crazy high value all apps will eventually hit your max threads. Limiting the minimum threads means it takes longer for your memory to go up, but it will do nothing to stop it from going up.

Member

schneems commented Mar 17, 2016

in my experience unless you set a crazy high value all apps will eventually hit your max threads. Limiting the minimum threads means it takes longer for your memory to go up, but it will do nothing to stop it from going up.

@trevorturk

This comment has been minimized.

Show comment
Hide comment
@trevorturk

trevorturk Mar 17, 2016

Contributor

@schneems gotcha, so this isn't really going to save you any memory. I don't know why Puma makes this option available, but I trust your experience anyway. Thank you!

Contributor

trevorturk commented Mar 17, 2016

@schneems gotcha, so this isn't really going to save you any memory. I don't know why Puma makes this option available, but I trust your experience anyway. Thank you!

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Mar 17, 2016

Member

No worries let me know if you see different behavior let me know.

Member

schneems commented Mar 17, 2016

No worries let me know if you see different behavior let me know.

@maclover7 maclover7 added the railties label Mar 17, 2016

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