Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

Azure/Python - download files quickly from storage

my Azure webapp needs to download 1000+ very small files from a blob storage directory and process them.

If I list them, then download them one by one, it takes ages... Is there a fast way to do it? Like to download them all together?

PS: I use the following code:

from azure.storage.blob import ContainerClient, BlobClient

blob_list = #... list all files in a blob storage directory

for blob in blob_list:
    blob_client = BlobClient.from_connection_string(connection_string, container_name, blob)
    downloader = blob_client.download_blob(0)
    blob = pickle.loads(downloader.readall())
question from:https://stackoverflow.com/questions/65898521/azure-python-download-files-quickly-from-storage

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I would also point out that since you are using azure-batch you could use the blob mount configuration in your linux VMs. So the idea will be to mount the drive to your VM, hence take out all the download time, and your drive is attached to the vm.

Thanks and hope this help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...