Python subprocess aws copy - 最大化网络带宽

问题描述

一个据称提供 >1Gbps 吞吐量的盒子上运行 python 3.4.2,我在一个内容循环中有以下代码,这些代码基本上从 s3 下载到 stdin 并通过 stdout 管道到另一个 s3 存储桶:

from_command = "aws --endpoint-url {0}  s3 cp {1} - --profile={2}".format(endpoint_url,cLeversafe_url.replace("cLeversafe","s3"),from_profile)
to_command = "aws s3 cp - {0}/{1} --expected-size={2} --profile={3}".format(s3_bucket,filename,content_size,to_profile)
#args are just breaking up to_command:                                
args = ['aws','s3','cp','-','{0}/{1}'.format(s3_bucket,filename),'--expected-size={0}'.format(content_size),'--profile={0}'.format(to_profile)]
p = subprocess.Popen(args,stdin=PIPE,stdout=PIPE,bufsize=-1)
output = p.communicate(from_command.encode("ascii"))

通过 nload 进行监控,我见过的最高输出速率约为 180Mbps。我可以在代码方面做些什么来增加这种吞吐量? (盒子是 Debian 8.11。)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)