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

Proposal to bump persistent_timeout to 65 seconds #3378

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shayonj
Copy link
Contributor

@shayonj shayonj commented May 3, 2024

Description

I noticed that if Puma's persistent_timeout is shorter than the load balancer's timeout, occasional minor service disruptions can occur. For instance, consider the AWS Application Load Balancer (ALB) with a default idle timeout of 60 seconds. If ALB forwards a request to Puma just as Puma is closing the socket, it may result in a broken TCP handshake, leading to a TCP RST/FIN being sent back to ALB. ALB would then handle that RST/FIN and return a 502 error to the client, which is not ideal.

Since most load balancers, like AWS ALB/ELB and Heroku, have default idle timeouts around 60 seconds and 55 seconds respectively, I am proposing that we increase Puma's persistent_timeout to 65 seconds so that the upstream negotiates and closes the connection before Puma does.

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

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

Successfully merging this pull request may close these issues.

None yet

1 participant