I've got a worker that processes a cloud queue messages. For each queue message, it creates a task and runs some short lambda with 2 IO operations.
For example, this is the lambda:
- Deserialize queue message's payload
- Send REST request to endpoint x (non-blocking IO operation)
- Do small computation work (sort of
JsonConvert.Deserialize
) - Enqueue new message to another cloud queue (non-blocking IO operation)
The worker is configured to keep up to 2000 running tasks.
Running this code solely on a VM - I can see that there are 14K Context Switches / sec and there are 300-500 threads running.
I'm wondering how many threads run in the default TaskScheduler thread pool.
How can I check that?