编程语言
首页 > 编程语言> > c#-在Azure队列上调用CreateIfNotExistsAsync()对性能的影响

c#-在Azure队列上调用CreateIfNotExistsAsync()对性能的影响

作者:互联网

我应该在Azure队列上的每次读/写之前调用CreateIfNotExistsAsync()吗?

我知道它会导致REST调用,但是它在队列上执行任何IO吗?

我正在将.Net库用于Azure Queue(如果此信息很重要).

解决方法:

该方法所做的只是尝试创建队列并捕获AlreadyExists错误,您可以通过在尝试访问队列时捕获404来轻松地复制自己.势必会影响性能.

更重要的是,它增加了您的成本:从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.

标签:azure,azure-queues,c,net
来源: https://codeday.me/bug/20191025/1932464.html