nitrojs / nitrojs/nitro

Default node preset should let you set keepAliveTimeout & headersTimeout

Open
#2,638 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

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
  • Would you be willing to help implement this feature?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the default Node preset and the code that generates its server configuration. Trace how preset options reach the generated file, then add coverage for configurable keepAliveTimeout and headersTimeout values and verify the generated configuration preserves them.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.