❔ How do i set request time out for .NET 6?
This is my Program.cs, i've tried setting the option.Limits.KeepAliveTimeout to 10s but the request that takes longer than that doesn't just throw up
10 Replies
you're saying you want the server to reject requests that take longer than 10 seconds to process?
I want to increase the time out for requests to the server
@V.EINA Jaken do you know how to increase it? Seems like it only available in .NET 8
is that a "yes"?
Yes
that is 100% not what
KeepAliveTimeout
does, for oneRFC 9112: HTTP/1.1
The Hypertext Transfer Protocol (HTTP) is a stateless application-level
protocol for distributed, collaborative, hypertext information systems.
This document specifies the HTTP/1.1 message syntax, message parsing,
connection management, and related security concerns.
This document obsoletes portions of RFC 7230....
This document obsoletes portions of RFC 7230....
for two, there's really no such thing as a server-side request timeout
not in general
timeouts are about entities waiting on something
an HTTP server that has received a request isn't waiting
it's processing the request
there's an option for how long the server will wait to RECEIVE the request
specifically, the request headers
KestrelServerLimits.RequestHeadersTimeout Property (Microsoft.AspNe...
Gets or sets the maximum amount of time the server will spend receiving request headers. Defaults to 30 seconds.
beyond that, an application that processes requests by doing database I/O might have a timeout for that database I/O
that's definitely got nothing to do with HTTP or Kestrel
the entity that's doing the waiting, during an HTTP request is the client
you can easily configure timeouts there
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.