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

Set the keep alive timeout to 31 seconds #1111

Merged
merged 5 commits into from
Mar 3, 2023
Merged

Conversation

samchungy
Copy link
Contributor

@samchungy samchungy commented Mar 2, 2023

The default Node.js server keep alive timeout is set to 5 seconds. However, the Gantry default ALB idle timeout is 30 seconds. This would lead to the occasional issues where the sidecar would throw proxyStatus 502 errors while trying to talk to your node application as it would believe that the socket is still open. AWS recommends setting an application timeout larger than the ALB idle timeout.

A more detailed explanation can be found in the below links

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
https://nodejs.org/docs/latest-v18.x/api/http.html#serverkeepalivetimeout

So far it has completely removed all 502 errors from the products-api and hirer graphql api

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2023

🦋 Changeset detected

Latest commit: 4c0524e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samchungy samchungy changed the title Set the keep alive timeout to 30.5 seconds Set the keep alive timeout to 31 seconds Mar 2, 2023
@samchungy samchungy marked this pull request as ready for review March 3, 2023 00:58
@samchungy samchungy requested review from a team as code owners March 3, 2023 00:58
Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙇

.changeset/fair-shrimps-count.md Outdated Show resolved Hide resolved
template/express-rest-api/src/listen.ts Outdated Show resolved Hide resolved
template/koa-rest-api/src/listen.ts Outdated Show resolved Hide resolved
samchungy and others added 3 commits March 3, 2023 14:34
Co-authored-by: Ryan Ling <ryan@outlook.com.au>
Co-authored-by: Ryan Ling <ryan@outlook.com.au>
Co-authored-by: Ryan Ling <ryan@outlook.com.au>
@samchungy samchungy merged commit cab3636 into master Mar 3, 2023
@samchungy samchungy deleted the keepAliveTimeout branch March 3, 2023 03:54
@seek-oss-ci seek-oss-ci mentioned this pull request Mar 3, 2023
72636c added a commit that referenced this pull request Mar 18, 2023
Proposed extension to #1111.
72636c added a commit that referenced this pull request Mar 18, 2023
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

2 participants