Performance gap between OCI Python SDK and boto3 for object downloads
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- backend, performance
調査の方向性
まず、示されている2つの OCI パス response.data.content と response.data.raw.stream を、boto3 のベースラインおよび報告されているオブジェクトサイズと並行性とともに使用して、比較を再現します。ソースファイルやテストは指定されていません。差が想定どおりかどうかを判断し、サポートされている最適化または説明を文書化できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Environment details
- Python version: 3.9.18
- pip version: 23.2.1
ociversion: 2.111.0
Issue
We are comparing the download performance of the OCI Python SDK and boto3 (AWS SDK). For the same objects stored in an OCI bucket, we’ve observed that the OCI SDK is approximately 20% to 50% slower than boto3 when downloading to memory.
Methods Tested with OCI SDK
- Using
response.data.content:
response = self._oci_client.get_object(
namespace_name=self._namespace, bucket_name=bucket, object_name=key, range=bytes_range
)
return response.data.content
- Using response.data.raw.stream
Get idea from this issue, this method is ~60% faster than method 1 but still ~20% slower than boto3:
response = self._oci_client.get_object(
namespace_name=self._namespace, bucket_name=bucket, object_name=key, range=bytes_range
)
content = bytearray()
for chunk in response.data.raw.stream(1024 * 1024, decode_content=False): # 1MB chunks
content.extend(chunk)
return bytes(content)
Note: We tested various chunk sizes, but they did not yield further improvements.
boto3 Baseline Implementation
response = s3_client.get_object(Bucket=bucket_name, Key=key)
return response['Body'].read()
Performance Results
With ThreadPoolExecutor(max_workers=16), I got following average throughput downloading 64MB x 1000 objects from the same OCI bucket to memory:
- boto3
get_object: 9.8 Gbps - OCI SDK
response.data.content: 4.1 Gbps - OCI SDK
response.data.raw.stream: 6.8 Gbps
The gap remains consistent across multiple test runs, including various multithreaded and multiprocessed setups.
Questions
- Is this performance gap expected?
- Are there any recommended optimizations or best practices for improving download performance with the OCI Python SDK?
- Are there any internal differences in how OCI supports S3-compatible APIs handling downloads that might explain the performance gap?
Thanks!
- 主要言語
- Python
- スター
- 474
- フォーク
- 321
- 平均マージ
- 23分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
oracle/oci-python-sdk のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
oracle/oci-python-sdk#890 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
oracle/oci-python-sdk#879 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
oracle/oci-python-sdk#878 ·
-
SDK
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
oracle/oci-python-sdk#861 · コメント 5 件 ·
-
SDK
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
oracle/oci-python-sdk#852 ·
oracle/oci-python-sdk の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·