I have a webapi2 service hosted in azure. I'm using a third-party library to send out SMS messages. This is a synchronous call and sometimes can take upwards of 10 seconds, blocking other requests from being handled during times of high traffic.
As far as I understand it, wrapping the method in Task. Run and then awaiting it, will NOT help, and may in fact worsen the situation. Task. Run will simply grab another thread from the same thread pool, but then incurs the overhead of having to switch back to the original context. From what I've read, Task. Run is really only useful for CPU-bound operations.
Without scaling my services, any ideas on how to increase throughput?