We have multi-tenant web app that our customers can extend on server by writing scripts. We want to limit web requests allowed execution time dynamically per tenant so one tenant cannot hurt others performance.
Allowed execution limit could depend on currently executing app action (front end, batch process...) and tenant pricing option (basic/premium...).
E.g. if we could do this in Global.asax.cs:
protected void Application_AcquireRequestState(object sender, EventArgs e)
{
// GetTimeoutForCurrentRequest contains our business logic
HttpContext.Current.Request.TimeOut = GetTimeoutForCurrentRequest();
}
All I wound by now are solutions like this and this that set limit statically for whole site of per url which don't workout for my case.