Azure存储上的连接池 [英] Connection pooling on Azure Storage

查看:69
本文介绍了Azure存储上的连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Azure存储将文件保存到应用程序上的Blob.由于我的应用程序可能会访问不同存储上的不同容器,因此我想知道如何实现可优化资源的连接池.

I'm starting to use Azure Storage to save files to blobs on my application. Since my application could be accessing different containers on different storages I would like to know how to implement a connection pool that will optimize resources.

我想保持对不同容器的连接打开,而不是每次尝试下载Blob时都打开连接

I want to keep the connection open to the different containers instead of opening a connection each time I try to download a blob

任何人都可以为我提供实现这一目标的最佳方法吗?

Can anyone provide me with the best approach to achieve this?

谢谢

推荐答案

您的问题的简单答案是,您实际上无法保持对Azure存储的开放连接,因为它本质上是基于请求/响应的HTTP连接.您向Azure存储发出请求,它向您发送响应,然后连接终止.

Simple answer to your question is that you can't really keep a connection open to Azure Storage as it is essentially an HTTP connection which is Request/Response based. You make a request to Azure Storage and it sends you a response and then the connection is terminated.

实际上,Azure存储不允许您长时间打开单个连接,因为它是一项服务,并且需要为像您这样的许多客户端提供服务.因此,如果您尝试执行的操作花费的时间比Azure存储服务指定的阈值长,则该服务将使您的请求超时.

In fact Azure Storage would not allow you to keep a single connection open for a long duration as it is a service and it needs to serve many clients like yours. So if you try to perform an operation which takes longer than the threshold specified by Azure Storage Service, the service will timeout your request.

这篇关于Azure存储上的连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆