Replies: 8 comments 4 replies
-
@jordie23 I encounter this exact issue, did you solve it somehow? |
Beta Was this translation helpful? Give feedback.
-
I will also want this feature, +1 |
Beta Was this translation helpful? Give feedback.
-
another discussions about this #19618 |
Beta Was this translation helpful? Give feedback.
-
How does anyone deploy next for anything serious outside of vercel? Between this and no way of enabling logging or integrating APM its very hard to maintain. |
Beta Was this translation helpful? Give feedback.
-
This is a serious issue on our application and setting the ALB timeout to 4s is not a viable option. NextJS is turning out to be a real headache in a production environment. |
Beta Was this translation helpful? Give feedback.
-
This was moved to a discussion, but doesn't seem to be discussed. This is a serious problem for running NextJS in production, outside of Vercel. While Next's commercial interests may lie with Vercel, this totally invalidates using NextJS in production on AWS, as a viable option. Considering the fix is as simple as allowing some additional config on next's httpServer, can we not get this moving at all? |
Beta Was this translation helpful? Give feedback.
-
I'm not too familiar with the internals of |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
NodeJS defaults
keepAliveTimeout
to 5 seconds. When NextJS is behind an AWS ELB/ALB, it can cause occasional 502 errors as the ELB's timeout is longer than Next's. To prevent this it should be the other way around where Next has a longer timeout than the ELB. Also need to be able to configureheadersTimeout
for this circumstance.More info can be found here: https://shuheikagawa.com/blog/2019/04/25/keep-alive-timeout/
Describe the solution you'd like
Ability to set in the NextJS config a way to set the values for
keepAliveTimeout
andheadersTimeout
.Describe alternatives you've considered
The only solution I was able to find was to modify the IdleTimeout on the AWS ELB to be 4 seconds, i.e 1 second less than node's default 5 seconds. This is a problem for any longer running requests (think 99th percentile or some intensive /api request) which will result in a 504 (gateway timeout).
A custom server could also be set up however I don't think this is a unique use case (anyone hosting on AWS behind a load balancer will have this issue).
Beta Was this translation helpful? Give feedback.
All reactions