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).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With