Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance impact of calling CreateIfNotExistsAsync() on a Azure queue

Should I call CreateIfNotExistsAsync() before every read/write on Azure queue?

I know it results in a REST call, but does it do any IO on the queue?

I am using the .Net library for Azure Queue (if this info is important).

like image 902
faisal Avatar asked Jun 13 '17 17:06

faisal


People also ask

How fast is Azure storage queue?

Both from local and a WorkerRole inside the same data center, the inserts max out at 5 per second, and average 4.73 per second.

What is the maximum size of queue message in Azure?

A queue message can be up to 64 KB in size. A queue may contain millions of messages, up to the total capacity limit of a storage account.


1 Answers

All that method does is try to create the queue and catches the AlreadyExists error, which you could just as easily replicate yourself by catching the 404 when you try and access the queue. There is bound to be some performance impact.

More importantly, it increases your costs: from Understanding Windows Azure Storage Billing – Bandwidth, Transactions, and Capacity [MSDN]

We have seen applications that perform a CreateIfNotExist [sic] on a Queue before every put message into that queue. This results in two separate requests to the storage system for every message they want to enqueue, with the create queue failing. Make sure you only create your Blob Containers, Tables and Queues at the start of their lifetime to avoid these extra transaction costs.

like image 164
stuartd Avatar answered Sep 27 '22 20:09

stuartd