I have a four layer application:
- HTML UI layer making AJAX calls to a UI Service (Web APIController).
- UI Service which is a Web API controller. UI Service calls App Service.
- App Service layer which has methods that call database directly through EF as well as make calls to other Domain services (Web APIs).
- Domain Service which are Web APIs too.
The first, second and third layers are hosted on one machine. The Domain Service is hosted on a different machine. The SQL Server is hosted on a different server.
My questions are:
How can I differentiate between CPU bound and IO bound calls? Are the calls made from the UI Service to the App Service, CPU bound because they exist in the same app domain?
Are the calls from the App Service to the Domain Service IO Bound because the calls go through network? Is it the case with calls made from the App Service to the DB also?
Should I make all the methods TASK based with async/await to take advantage of the scalability? What I mean by scalability is that the IIS where the HTML UI layer, UI Service and App Service have hosted can process more requests?
What will happen under a heavy traffic on the website if I don't have async APIController? Will some users get a 404 because the IIS can't handle many requests?
What will happen under a heavy traffic scenario on the website if I have a async APIController? Will all the users see the UI although it is little bit late because IIS can handle all the requests but they are all queued?