Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3311784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:55:03+00:00 2026-05-17T21:55:03+00:00

I have one worker role that throws data into around 10 queues that need

  • 0

I have one worker role that throws data into around 10 queues that need to be processed. There is a lot of data – probably around 10-100 messages a second that gets queued up in various queues.

The queues hold different data and process them separately. There is a single queue in particular that is very active.

The way I have it setup now, I a separate worker role that spawns 10 different threads, each thread executes a method that has a while(true){get message from queue and process it}. Whenever data in the queue gets backed up we simply launch more of these processes to help speed up the processing of the data from the queue. Also, since one queue is more active, I actually launch a number of threads pointing at the same method to process data from that queue.

However, I am seeing high CPU utilization of the deployment. Almost at or near 100% constantly.

I am wondering if this is because of thread starvation? Or because accessing the queue is RESTful and the threads end up blocking each other via doing the connection and slowing things down? Or, is it because I use:

while(true)
{
   var message = get message from queue;
   if(message != null)
   {
       //process message
   }
}

And that gets executed too fast?

Every processing of the message also saves it to the Azure Table Storage or the DB – so it might be the process of saving this data that is eating up the CPU.

In effect, it’s been really hard to debug the high CPU load. So, my question is: are there general architecture changes that I can make that will help alleviate + prevent any possible issue that there might be? (e.g. instead of using while(true) using a different type of polling – although I’d imagine it’s the same in the end for that example).

Maybe simply spawning new threads using new Thread() is not the best way to go.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:55:03+00:00Added an answer on May 17, 2026 at 9:55 pm

    I would suggest putting a sleep statement in your loop… not only is that tight loop probably hogging CPU resources, but you also pay for storage transactions. Every ten thousand times you check the queue, it costs a penny. That’s a small cost, but it could add up over time to be significant.

    I’ve also often used code like this:

    while(true)
    {
    var msg = q1.GetMessage();
    if (msg != null) { ... }
    msg = q2.GetMessage();
    if (msg != null) { ... }
    }

    In other words, poll the queues serially instead of parallelly (that should totally be a word). That way you’re only actually doing one thing at a time (useful if your tasks are CPU-instensive), but you’re still checking all the queues in each loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one field that I need to sum lets say named items However
I have one thread that writes results into a Queue. In another thread (GUI),
I have one website on my server, and my IIS Worker Process is using
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
I have one site that is displaying html content that needs to be displayed
I have one text input and one button (see below). How can I use
I have one std::list<> container and these threads: One writer thread which adds elements
I have one application which uses the standard .NET forms authentication cookie, now I
I have one user who gets an error message when he closes his browser.
I have one aspx page with some controls. Also i have one DIV which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.