测量 Python 中 s3 存储桶消耗的进出带宽

Measure consumed in and out bandwidth from s3 bucket in Python

我正在使用带 Amazon S3 存储桶的云计算。最近,S3 的出站使用成本激增。我对我的代码进行了各种更改,因此我无法查明额外费用的来源。有没有 python 包可以帮助我用 S3

测量我的 io

你应该Log requests using server access logging - Amazon Simple Storage Service.

服务器访问日志记录将在 Amazon S3 中创建(许多)日志文件,您可以在其中监控请求和响应的大小 (Bytes Sent)。

参见:Amazon S3 server access log format - Amazon Simple Storage Service

日志文件的数量以及每个日志文件中的内容量可能会导致难以分析。您可能希望使用 Amazon Athena 查询这些访问日志

参见:Analyze S3 server access logs using Athena