AWS CLI比使用boto3快吗? [英] Is aws CLI faster than using boto3?

查看:109
本文介绍了AWS CLI比使用boto3快吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的软件包存储在s3存储桶中.我需要读取每个程序包的元数据文件,并将元数据传递给程序.我使用了 boto3.resource('s3')来读取python中的这些文件.该代码花了几分钟才能运行.如果我使用aws cli sync ,它下载这些图元文件的速度比boto快得多.我的猜测是,如果我不下载并仅阅读元文件,它应该会更快.但事实并非如此.可以肯定地说aws cli比使用boto更快吗?

解决方案

以我的经验,我还没有看到CLI比boto更快.正如helloV所提到的那样,CLI是由专业人士编写的,并保持在最佳水平,而初级用户则是由boos编写的.

如果您只需要元数据并且希望使用boto脚本快速处理,我强烈建议您使用客户端而不是资源以及名为 解决方案

In my experience I have not seen CLI to be faster than boto. As helloV mentioned CLI was written by pros and is maintained at optimal levels wheras boto is written by users junior to master.

If you need just metadata and want to be fast with a script using boto I highly recommend using client instead of resource and a method named head_object which does a read but not a download and metadata is retrievable in the json response structure.

这篇关于AWS CLI比使用boto3快吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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