I've got a question about whether it's beneficial to use async/await on WebAPI / MVC Controller AJAX requests.
Say I've got this AngularJS app that talks to a WebAPI backend and I want to get some data. I do some AJAX call to WebAPI and wait for the results.
In terms of the client, this is of course Async. Would it now be beneficial for the server if I was to make these actions Async?
EDIT
I just found this: http://www.dotnetcurry.com/showarticle.aspx?ID=948 - saying it IS
EDIT - attempt to clarify Let me try to be more clear. Will the processor load on the server be less if I implement all the calls to the service layer from my WebAPI as async (the .NET keyword) vs. 'normal'?
Will IIS spawn more threads in case all the methods are NOT Async, thereby using up more memory for instance?
If your action method hits a database or filesystem, or makes another network request (i.e. something that requires waiting on IO) then making the action async will have some benefit if your server is under heavy load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With