I have one worker role that throws data into 10 queues that need to be processed. There is a lot of data - perhaps around 10-100 messages per second that are queued in different queues.
Queues store different data and process it separately. In particular, there is one queue that is very active.
Now I have a setting, I have a separate working role that spawns 10 different threads, each thread executes a method that takes some time (true) {receive a message from the queue and process it}. Whenever data in a queue is returned, we simply run more of these processes to speed up the processing of data from the queue. In addition, since one queue is more active, I actually run several threads pointing to the same method to process data from this queue.
However, I see high CPU utilization during deployment. Almost constantly or almost 100%.
I wonder is it because of hunger? Or because the access to the queue is RESTful, and the threads end up blocking each other, connecting and slowing down? Or because I use:
while(true)
{
var message = get message from queue;
if(message != null)
{
}
}
And is this running too fast?
Azure - , .
, . , : , , + , ? (, , while (true), , , ).
, Thread() - .