1

Assume I have 2 application hosted on IIS within the same machine.

Application A - very busy, has to serve lots of requests.

Application B - not busy at all, has to serve only few but heavy IO requests.

My question: If response time of Application B does not matter, does use of async in Application B save time for Application A?

I think, it may save time because when Application B will operate IO bound operation, if there is an async way CPU will not be suspended and waiting for the IO signal.

So, Application A would benefit from it. But I'm not sure if I'm right about it. Or, the impact is only on other threads within the same application (i.e. Application B).

Can someone clarify this?

Trevor Reid
  • 3,310
  • 4
  • 27
  • 46
Roni
  • 369
  • 1
  • 7
  • 22

1 Answers1

1

Using async in Application B will make it use less threads, and since each thread requires 1MB for its stack, the memory used by the Application B will be reduced. Since the Application B is not busy, the number of threads it uses is probably already small, so I expect that switching to async will have negligible effect to the whole system.

Btw there is no such thing as "suspended CPU". You can suspend a software thread, not a CPU. The CPUs are managed by the operating system.

Theodor Zoulias
  • 34,835
  • 7
  • 69
  • 104
  • Thanks for the clarification. If for some reason `Application B` will be busy too, does it influence now or every application has its fixed memory slice? – Roni Oct 11 '20 at 12:49
  • 1
    @Roni I am not really sure. Maybe the IIS has some option to restrict the memory used by each application. But if both applications are busy, then the memory may not be the only possible contended resource. The CPU, or the network bandwidth, or the storage I/O could be saturated too. – Theodor Zoulias Oct 11 '20 at 13:09