Base topic: Does Parallel.ForEach use threads from the ASP.NET thread pool?
I am wondering if microservice is deployed to multi-instance clustered containerized environment (like k8s) and uses Parallel.For, Parallel.ForEach, Task.WaitAll,...), how TPL parallel code affects scale-out (not scale-up) abilities?
It is understandable that one request is processed faster if TPL is used, but other requests may suffer if there is only one instance (webserver) for microservice. What about multiple instances of the same microservice (inside k8s clustered environment) and internal load balancer before each microservice? Internal load balancer should transfer a new request to different instance of microservice if the first instance is currently overloaded. Therefore scale-out abilities should not suffer when using TPL, right?
Thank you for your explanations.
It's hard to test potential drawbacks in development time.