unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

Default node preset should let you set keepAliveTimeout & headersTimeout #2638

Open hecktarzuli opened 1 month ago

hecktarzuli commented 1 month ago

Describe the feature

In larger environments that get a decent amount of traffic, it's important that the node keepAliveTimeout & headersTimeout are able to be set (the default is 5s for keepAliveTimeout). Currently the only way to do that is to add it to the generated file post-build (fragile), or create a whole new preset on your own (and lose all of the great stuff already in the current preset)

In our prod env (50+ servers), we were getting tens of thousands of 502's per day because the node keepAliveTimeout was so low compared to our Application Load Balancer idleTimeout (30s)

related: https://github.com/nuxt/nuxt/issues/18857 https://github.com/nuxt/nuxt/issues/9740

Additional information

unite4 commented 1 month ago

There is already a pull request: https://github.com/unjs/nitro/pull/1944