Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

How to specify / modify request timeout #611

Closed
ayende opened this issue Feb 2, 2016 · 12 comments
Closed

How to specify / modify request timeout #611

ayende opened this issue Feb 2, 2016 · 12 comments

Comments

@ayende
Copy link

ayende commented Feb 2, 2016

I couldn't find a way in the API to set the request timeout, and (preferably) a way to dynamically change it.
Like this:

HttpContext.Current.Server.ScriptTimeout = 60 * 60 * 6;

Is this possible?

(Also, is this the right place to ask, is there a mailing list / forum?)

@davidfowl
Copy link
Member

HttpContext.Current.Server.ScriptTimeout = 60 * 60 * 6;

That only worked for synchronous requests in ASP.NET not async ones (AFAIK)

Is this possible?

There's no http request timeout in kestrel. #484

(Also, is this the right place to ask, is there a mailing list / forum?)

@ayende if it's kestrel specific you can ask here. Otherwise, best to ask on aspnet/Home and have it be redirected.

@ayende
Copy link
Author

ayende commented Feb 2, 2016

@davidfowl Thanks,.

So what would be the behavior if I'm making an async operation in the request that doesn't timeout?
Do we rely on the client to give up on this?

I'm actually very happy that I don't need to manage that, by the way.

The issue is that I have a client that is uploading a large dataset, and I had to manage this with the previous version of ASP.Net.
Note having limits that I constantly have to manage is great, but on the other hand, what happens if a client open a request, write three bytes, and keep the connection open?

Do we rely on TCP to close the connection?

What happens if we have a client that send a byte per second? And thus creating tens of thousands of connections? That can cause us to hold a lot of state in memory.

@davidfowl
Copy link
Member

So what would be the behavior if I'm making an async operation in the request that doesn't timeout?
Do we rely on the client to give up on this?

Currently yes. There's going to be a pass done to make sure there's limits for things like these (the issue I pointed you to), along with other limits (max body, max query, max headers etc).

The issue is that I have a client that is uploading a large dataset, and I had to manage this with the previous version of ASP.Net.
Note having limits that I constantly have to manage is great, but on the other hand, what happens if a client open a request, write three bytes, and keep the connection open?

Do we rely on TCP to close the connection?

What happens if we have a client that send a byte per second? And thus creating tens of thousands of connections? That can cause us to hold a lot of state in memory.

https://en.wikipedia.org/wiki/Slowloris_(computer_security)

All of these things are why we recommend that you host kestrel behind a reverse proxy like nginx. That's not to say we won't address some of these features in general. Some we will, some we want.

@davidfowl
Copy link
Member

Here's a PR from @benaadams adding some timeout logic #485

@muratg
Copy link
Contributor

muratg commented Mar 14, 2016

Closing this one (#485)

@muratg muratg closed this as completed Mar 14, 2016
@mskryvonos
Copy link

@muratg @davidfowl That PR hasn't actually went through, do you know if there are any plans to add this functionality to Kestrel in 1.1 release?

@muratg
Copy link
Contributor

muratg commented Sep 6, 2016

cc @CesarBS

@cesarblum
Copy link
Contributor

I'm currently working on adding timeouts to Kestrel. There's a PR out for keep-alive (#1066) and I will be sending another one soon for request headers and request body timeouts.

@MelbourneDeveloper
Copy link

I've got a WCF timeout occurring. I've set all the WCF timeouts to 24 hours. Is it possible that Kestrel is timing out? How do I set the timeouts for Kestrel?

@davidfowl
Copy link
Member

What kind of timeout are you looking for?

@Tratcher
Copy link
Member

Tratcher commented Apr 4, 2018

@paulgmiller not a global one. MinResponseDataRate is as close as it gets.

Call WriteAsync with a CancellationToken.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants