How do I improve performance while doing pull, push and delete from Azure Storage Queue

       
Hi,
I am working on a distributed application with Azure Storage Queue for message queuing. queue will be used by multiple clients across the clock and thus it is expected that it would be heavily loaded most on the time in usage. business case is typical as in
it pulls message from queue, process the message then deletes the message from queue. this module also sends back a notification to user indicating process is complete. functions/modules work fine as in they meet the logical requirement. pretty typical queue
scenario.
Now, coming to the problem statement. since it is envisaged that the queue would be heavily loaded most of the time, I am pushing towards to speed up processing of the overall message lifetime. the faster I can clear messages, the better overall experience
it would be for everyone, system and users.
To improve on performance I did multiple cycles for performance profiling and then improving on the identified "HOT" path/function.
It all came down to a point where only the Azure Queue pull and delete are the only two most time consuming calls outside. I can further improve on pull, which i did by batch pulling 32 message at a time (which is the max message count i can pull from Azure
queue at once at the time of writing this question.), this returned me a favor as in by reducing processing time to a big margin. all good till this as well.
i am processing these messages in parallel so as to improve on overall performance.
pseudo code:
//AzureQueue Class is encapsulating calls to Azure Storage Queue.
//assume nothing fancy inside, vanila calls to queue for pull/push/delete
var batchMessages = AzureQueue.Pull(32); Parallel.ForEach(batchMessages, bMessage =>
//DoSomething does some background processing;
try{DoSomething(bMessage);}
catch()
//Log exception
AzureQueue.Delete(bMessage);
With this change now, profiling results show that up-to 90% of time is only taken by the Azure Message delete calls. As it is good to delete message as soon as processing is done, i remove it just after "DoSomething" is finished.
what i need now is suggestions on how to further improve performance of this function when 90% of the time is being eaten up by the Azure Queue Delete call itself? is there a better faster way to perform delete/bulk delete etc?
with the implementation mentioned here, i get speed of close to 25 messages/sec. Right now Azure queue delete calls are choking application performance. so is there any hope to push it further.
Does it also makes difference in performance which queue delete call am making? as of now queue has overloaded method for deleting message, one which except message object and another which accepts message identifier and pop receipt. i am using the later
one here with message identifier nad pop receipt to delete message from queue.
Let me know if you need any additional information or any clarification in question.
Inputs/suggestions are welcome.
Many thanks.

The first thing that came to mind was to use a parallel delete at the same time you run the work in DoSomething.  If DoSomething fails, add the message back into the queue.  This won't work for every application, and work that was in the queue
near the head could be pushed back to the tail, so you'd have to think about how that may effect your workload.
Or, make a threadpool queued delete after the work was successful.  Fire and forget.  However, if you're loading the processing at 25/sec, and 90% of time sits on the delete, you'd quickly accumulate delete calls for the threadpool until you'd
never catch up.  At 70-80% duty cycle this may work, but the closer you get to always being busy could make this dangerous.
I wonder if calling the delete REST API yourself may offer any improvements.  If you find the delete sets up a TCP connection each time, this may be all you need.  Try to keep the connection open, or see if the REST API can delete more at a time
than the SDK API can.
Or, if you have the funds, just have more VM instances doing the work in parallel, so the first machine handles 25/sec, the second at 25/sec also - and you just live with the slow delete.  If that's still not good enough, add more instances.
Darin R.

Similar Messages

  • How can we improve performance while selection production orders from resb

    Dear all,
    there is a performance issue in a report which compares sales order and production order.
    Below is the code, in this while reading production order data from resb with the below select statement.
    can any body tell me how can we improve the performance? should we use indexing, if yes how to use indexing.
    *read sales order data
      SELECT vbeln posnr arktx zz_cl zz_qty
      INTO (itab-vbeln, itab-sposnr, itab-arktx, itab-zz_cl, itab-zz_qty)
      FROM vbap
      WHERE vbeln  = p_vbeln
      AND   uepos  = p_posnr.
        itab-so_qty = itab-zz_cl * itab-zz_qty / 1000.
        CONCATENATE itab-vbeln itab-sposnr
           INTO itab-document SEPARATED BY '/'.
        CLEAR total_pro.
    **read production order data*
        SELECT aufnr posnr roms1 roanz
        INTO (itab-aufnr, itab-pposnr, itab-roms1, itab-roanz)
        FROM resb
        WHERE kdauf  = p_vbeln
        AND   ablad  = itab-sposnr+2.

    Himanshu,
    Put a break point before these two select statements and execute in the production.This way you will come to know which select statement is taking much time to get executed.
    In both the select statements the where clause is not having the primary keys.
    Coming to the point of selecting the data from vbap do check the SAP note no:-185530 accordigly modify the select statement.
    As far as the table RESB is concerened here also the where clause doesn't have the primary keys.Do check the SAP Note No:-187906.
    I guess not using primary keys is maring the performance.
    K.Kiran.

  • How can I improve performance when scopes are open?

    How can I improve performance when scopes are open?
    When Color correcting, performance severely lags, stalls, freezes!
    Nothing to complex...simple 3 way color corrector, occasional curves filters.
    I am constantly waiting for the timeline to update as I move around....sometimes as long as a minute or so.
    I'm on brand new 2.7 Ghz 12-Core MacPro with 64 GB of RAM
    Thanks in advance.
    Jay

    http://forums.adobe.com/thread/1369260?tstart=0

  • HT204266 I lost iphoto while doing an erase and reload,  I just had to buy it again?

    Hi
    While doing a 'wipe and reload' as advised by a genius at Southampton Store,  I managed to lose a whole raft of stuff because my back up to time capsule decided it didnt want to let me restore.  I have recovered most of the stuff but seem to have lost iphoto.  It was very important to me so I went online and bought it again.   I believe that as I had it already, that I should have been able to reload it without paying. Is there any way I can obtain a refund please?
    Next question:   all the same applies to iWeb as well and I am trying to find it online, but the Apple site seems to have everything related to iWeb but not the actual program.  
    I really do need to recover these two programs.   I have iphoto (big relief)  and just would like to get my pennies back, and I believe it is probably only my own lack of knowledge that is preventing me from finding iWeb to download.  Previous advice gratefully received told me not to download from any other sites, so that is a rule I am following.
    Any advice most gratefully received please
    Many thanks
    Steve

    You did not initially purchase it. Pre-order in iTunes means that they are reserving the content for you at that price. The link below is an article on how pre-orders work with iTunes. When you pre- order an album in iTunes it just means its reserving it at that price, since the price may change. When the album is available and released, iTunes will automatically download it should you have enough store credit on the account or a valid credit card on the account.
    http://support.apple.com/kb/HT5714

  • Lightroom 1.3 Catalog froze while doing a task and has vanished

    Can anyone shed some light on why my Lightroom catalog froze on my Macbook Pro while doing a task and then was no where to be found upon booting up?! It was a small catalog and I had not backed it up. I guess I will make sure to back up the catalog every day from now on. Is it possible for Lightroom to crash and to lose the entire catalog just like that?

    Pretty much no. What task was underway? What's in your LR folder? Did you have no backup at all? BTW, you may find your catalog is where it should be, but possibly your LR Prefs file is florfenated. Delete it, then double click on the library file to launch.

  • What does clearing cookies and data from iPad 4 mean?

    What does clearing cookies and data from iPad 4 mean?

    http://ipad.about.com/od/ipad_basics/ss/How-To-Clear-Cookies-And-Web-History-In- The-iPad-Safari-Browser.htm
     Cheers, Tom

  • How can I fine a photo on icloud that is deleted from my camera roll

    How can I find a photo on icloud that is deleted from my camera roll

    All photos captured or saved with the iPhone are stored in the Camera Roll which cannot be changed.
    You can create an album to place photos in that are in the Camera Roll which does not duplicate the photo. It creates a pointer to the original photo stored in the Camera Roll. If the original is deleted from the Camera Roll, it will be removed from the album as well.
    Import the photos from the Camera Roll with your computer as with any other digital camera followed by deleting the photos from the Camera Roll after the import process is complete. Create an album or albums for the imported photos on your computer followed by transferring the albums from your computer via the iTunes sync process which is selected under the Photos tab for your iPhone sync preferences with iTunes.

  • How do I combine all my calendars into one and delete the others?

    I have a work computer, a home desktop, and Apple air laptop and an 1phone 4s.
    I use Outlook calendar for all my appointments and only need one calendar.
    When I get notifications of my upcoming events on the Oulook page and on my iphone, I get multiple notifications, sometimes as many as 6 times.
    How can I combine all my calendars into one and delete the others?

    Your old account is the one you migrated, but it has been renamed because the new account had the same name. "Fixing" this is a bit complicated. It is possible to transfer data from one account to the other. See Transferring files from one User Account to another.
    A cleaner solution is to do this:
    Create a temporary new admin user account with a completely different username.
    Log into this new account.
    Delete the new account you created before migrating.
    Delete the old account you migrated that has the changed name.
    Re-migrate your old account from the Mini.
    Log into the newly migrated account and delete the temporary account.
    And, the simplest solution is to use the migrated account as-is and delete the account you originally made on the new computer.

  • Can I do a clean install of Lion, onto my Mac Book Pro4,1, that is currently running 10.5.8? I have seen U-tube videos on how to do a clean install to Snow Leopard, and another from SL to Lion, but can zero out my HD, and do a clean install to Lion?

    Can I do a clean install of Lion, onto my Mac Book Pro4,1, that is currently running 10.5.8? I have seen U-tube videos on how to do a clean install to Snow Leopard, and another from SL to Lion, but can zero out my HD, and do a clean install to Lion?

    See this article.

  • How do i save audio books to a file then delete from phone

    How do I save an audio book to file then delete from my Iphone.

    Perhaps he wants to free up space on the iPhone. The audio Books are a single download purchase, meaning you can't download them again for free.

  • Apple charged me 8 times $1 while changing the country and purchase from app stores. Help pls

    Hi all
    Apple charged me 8 times $1 while changing the country and purchase from app stores.
    Help pls, I want my money back

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Advice?  point me to instructions how to reinstall 10.6.X on (2007) iMac, and delete 10.8

    Advice.
    Can someone point me to instructions how to reinstall 10.6.X on (2007) iMac, and delete 10.8 ? I have disc for 10.6.3.

    Here are some guides.
    https://discussions.apple.com/docs/DOC-3393
    http://support.apple.com/kb/HT3910?viewlocale=en_US

  • I just sold my iPhone 4s after doing a reset and deleting data and settings. Is there anyway the buyer can see any of my old photos, texts, or data? I have confidential info for work and family photos and freaked out that they can be found somehow.

    I just sold my iPhone 4s after doing a reset and deleting data and settings. Is there anyway the buyer can see any of my old photos, texts, or data? I have confidential info for work and family photos and freaked out that they can be found somehow.

    No, but if the answer was yes it's a little late to start getting freaked out about it.

  • How do I re-download videos which have been uploaded onto iCloud and deleted from my device?

    How do I re-download videos which have been uploaded onto iCloud and deleted from my device?

    Hi yvrtoakl,
    I'm sorry, I'm a bit unclear on what you mean by "uploaded onto iCloud". If you are referring to videos synced to iCloud using the new iCloud Photo Library feature, you may find the following article helpful:
    iCloud Photo Library beta FAQ - Apple Support
    On the other hand, if you are talking about video files that have been stored on iCloud using iCloud Drive, then this article may be of more use:
    iCloud Drive FAQ - Apple Support
    Regards,
    - Brenden

  • I'm about to transfer the contents of my existing HDD in my (dead PSU) iMac to another computer. I'm just wanting to know if and how I will be able to access my files and documents from the old hard drive once I've made the backup?

    I'm about to transfer the contents of my existing HDD in my (dead PSU) iMac to another computer. I'm just wanting to know if and how I will be able to access my files and documents from the old hard drive once I've made the backup?

    You are not going to be able to run your old system from the backup on this old computer as the hardware is incompatible.
    You need to get a new computer or a refurbished one.

Maybe you are looking for

  • Why isn't the default outgoing email setting working correctly?

    In my mail preferences I have send new messages from a specific email address selected. However, mail just keeps sending from the inbox address I am currently in. I really need the default to work. It used to before I upgraded to Mountain Lion.

  • Dreamweaver Problem

    Hi I have a problem that you may be able to help me with. I have created a template in Dreamweaver (master template). I have then created another template (secondary template) from the master template, I have then created pages from this secondary te

  • Sorting of Dyanmic internal table

    Hi Gurus, I am having a dynamic internal table (it_mat) having  fields matnr uname field1,field2,field3 and field4. the field is upto fieldN. I want my table to sorted by this manner Sort it_mat by field4 field3 field2 field1. Sort it_mat by fieldN f

  • LocalSessionFactoryBean - Could not instantiate bean class

    Hello, I am facing a problem with the instantiation of the LocaSessionFactoryBean in a sample Spring 3.0.4 - Hibernate 3.2.6, WebLogic 10.3.3 and Oracle 10g. I am run an web application using JDeveloper 11.1.1.3.0 with the integrated WebLogic Server

  • Elements MAC vs PC versions

    Hi all, I have Elements for the PC and really enjoy using the organizer function and the cataloging function. As I moved to the MAC version, Adobe seemed to have omitted the catalog. Any advice or 3rd party applications that can bridge that gap? Does