Does anyone know how to set the keepAliveTimeout for nitro in Nuxt 3?

We're having some large issues with AWS's Application Load Balancer and Nuxt 3, it seems to stem from node's default of 5s keepAliveTimeout.
8 Replies
peako
peako5mo ago
GitHub
Nuxt3 set server.keepAliveTimeout · Issue #18857 · nuxt/nuxt
Describe the feature this issues to nuxt3 #9740 hooks: { listen(server) { server.keepAliveTimeout = 0 server.headersTimeout = 0 } }, This has no effect in nuxt3 How to set server.keepAliveTimeout A...
peako
peako5mo ago
GitHub
Nuxt3 set server.keepAliveTimeout · Issue #18857 · nuxt/nuxt
Describe the feature this issues to nuxt3 #9740 hooks: { listen(server) { server.keepAliveTimeout = 0 server.headersTimeout = 0 } }, This has no effect in nuxt3 How to set server.keepAliveTimeout A...
Josh Deltener
Josh DeltenerOP5mo ago
yeah i saw those too, not great 😦
peako
peako5mo ago
:\
Josh Deltener
Josh DeltenerOP5mo ago
@manniL / @danielroe / @Atinux any better way to set this? Here's my terrible tweak that seems to work..
"scripts": {
"build": "nuxt build && echo 'server.keepAliveTimeout = 35000;server.headersTimeout = 36000;' >> .output/server/chunks/runtime.mjs"}}
"scripts": {
"build": "nuxt build && echo 'server.keepAliveTimeout = 35000;server.headersTimeout = 36000;' >> .output/server/chunks/runtime.mjs"}}
I beat up my server for 10 min and had zero errors from the load balancer .. but this solution is fragile, there should be a super easy way to do this natively that doesn't involve creating my own Nitro preset or something.
manniL
manniL5mo ago
This should be raised in https://github.com/unjs/nitro, targeting the node preset I think I think it could be resolved with a custom preset at the moment based on the node one 🤔
Josh Deltener
Josh DeltenerOP5mo ago
https://github.com/unjs/nitro/issues/2638 I really don't want to create my own node preset just to control 2 values for the server being spun up (and loose all the great stuff the preset already has)
manniL
manniL5mo ago
You can extend the current one and simply add the two lines to the generated server, similar to what you do now but a bit more declarative I personally think that an easier way to config would be better
Want results from more Discord servers?
Add your server