The web service I develop must respond in 6 seconds max. If web service is unabled to respond in 6 seconds it must respond with some hardcoded data.
The web service is kind of proxy which transforms incoming data and makes a request to another service. That service is third-party and may fail or respond too long.
Currently there is restriction in application code which limits timeout to third-party service to 3 seconds (remember, total respond time is 6 seconds max).
But the problem is application has very high load and sometimes it is unabled to execute their code in rest of 3 seconds (but without loading our app code is executed in milliseconds, there are really a little of code). I believe that Windows is unabled to run all threads and sometimes threads sleeps more than 3 seconds, and max respond time is violated without possibility to handle this.
The application is developed in asp.net core in C# and fully async.
So question: is it possible to limit response time on IIS level? Is it possible to respond with predefined data if timeout occured? Is there a way except adding extra instances to Azure to improve responsiveness? Is there a programmatic way to handle timeouts robust?
EDIT
I need
- Guaranteed response time on IIS with high-load. Is it possible at all on non-realtime OS?
- When request is not processed in time send predefined hardcoded response.
- Do this on Azure