Connection pooling on Azure Storage

此生再无相见时 提交于 2019-12-23 09:31:53

问题


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.

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?

Thanks


回答1:


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.

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.



来源:https://stackoverflow.com/questions/24531458/connection-pooling-on-azure-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!