Azure:配置BlobEndpoint和CloudBlobClient以获得最大上载吞吐量
我正在为每个请求使用Azure:配置BlobEndpoint和CloudBlobClient以获得最大上载吞吐量,azure,azure-storage,azure-storage-blobs,Azure,Azure Storage,Azure Storage Blobs,我正在为每个请求使用cloudblockclient更新大量CloudBlockBlob(总是相同的blob) BlobEndpoint的参数设置如下: blobEndpoint.UseNagleAlgorithm<-false blobEndpoint.ConnectionLimit<-1000 //blobEndpoint.MaxIdleTime<-Timeout.Infinite blobEndpoint.UseNagleAlgorithm要实现稳定的高槽输出,需要一定
cloudblockclient
更新大量CloudBlockBlob
(总是相同的blob)
BlobEndpoint
的参数设置如下:
blobEndpoint.UseNagleAlgorithm<-false
blobEndpoint.ConnectionLimit<-1000
//blobEndpoint.MaxIdleTime<-Timeout.Infinite
blobEndpoint.UseNagleAlgorithm要实现稳定的高槽输出,需要一定程度的并行性。
看看你是否能利用这个机会
//使用新Azure存储数据移动库中的接口上载blob
//设置并发操作的数量
TransferManager.Configurations.ParallelOperations=64;
//设置传输上下文并跟踪upoload进度
TransferContext=新的TransferContext();
context.ProgressHandler=新进度((进度)=>
{
WriteLine(“上传的字节:{0}”,progress.ByTestTransfered);
});
//上载本地blob
var task=TransferManager.UploadAsync(
sourcePath、destBlob、null、上下文、CancellationToken.None);
task.Wait();
这是东西的基础,所以你知道这是一件严肃的事情。我找到的解决方案是在system.net中将maxconnection
设置为1000
比blob端点上的ConnectionLimit
工作得好得多。根据需要,您应该配置ServicePointManager.DefaultConnectionLimit
设置
文章建议将其设置为处理器数乘以8,如下所示:
ServicePointManager.DefaultConnectionLimit=Environment.ProcessorCount*8代码>
CloudBlobClient
类使用一个内部IHttpClient
,它使用此设置。我在相当多的线程上为每个请求使用不同的CloudBlobClient。您是否建议使用单一客户端?