Last post Apr 26, 2020 02:11 AM by EnenDaveyBoy
Apr 03, 2020 03:26 PMemail@example.com|LINK
We're creating an ASP.NET service that presents a REST API. Is there a good resource on how best we should set this up on IIS? Our service can take between seconds to minutes to process a request.
The big questions I see are:
??? - thanks - dave
Apr 03, 2020 03:45 PM|mgebhard|LINK
IIS simply hosts a web application/service. All of your questions are related to designing and writing a web application/service which encompasses the entire .NET stack.
If it's an async request (give us the request, return immediately before the request is processed), can we pass that job off to IIS and it has a pool of worker threads to process it?
How can we get the status of any background job?
It's a matter of state management which is a problem that must be solved in every web application. One solution is designing the background job to save its current status in a database table. The client reads the table to find the status.
How can we get the number of pending jobs?
Same as above.
If it's a sync request, will that then go before any pending requests?
I have no idea how you application works and cannot answer this question. Keep in mind each HTTP request is a separate thread.
And limits on request or response size? The requests will generally be 5M - 50M, and sometimes up to several G. The response on completion will tend to be 20M - 200M and again can be several G.
It is more efficient if you can process the 5M - 50M without sending the data over HTTP.
What else am I missing?
Can you explain the user case for creating the service?
Apr 03, 2020 03:54 PMfirstname.lastname@example.org|LINK
Thank you for your reply. Let me ask a more basic question and I may have a misconception here.
Doesn't IIS provide the ability to hand off background tasks to it to process from an app pool? If so, that let's me avoid creating my own job queue, thread pool, etc.
??? - dave
Apr 03, 2020 04:15 PM|mgebhard|LINK
Doesn't IIS provide the ability to hand off background tasks to it to process from an app pool?
A web site is just an
HTTP service; one request, one response. It is up to you to design and write the background task logic. Keep in mind, web application are not good candidates for running background tasks. Web applications spin down after non use which will stop the
background task unexpectedly.
An application pool defines a group of one or more worker processes, configured with common settings that serve requests to one or more applications that are assigned to that application pool. Because application pools allow a set of Web applications
to share one or more similarly configured worker processes, they provide a convenient way to isolate a set of Web applications from other Web applications on the server computer. Process boundaries separate each worker process; therefore, application problems
in one application pool do not affect Web sites or applications in other application pools. Application pools significantly increase both the reliability and manageability of your Web infrastructure.
Apr 26, 2020 02:11 AM|EnenDaveyBoy|LINK
have you thought about using Azure functions or Amazon AWS?