Performance gap between OCI Python SDK and boto3 for object downloads
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend, performance
Direzione di ricerca
Inizia riproducendo il confronto utilizzando i due percorsi OCI indicati: response.data.content e response.data.raw.stream, insieme alla baseline boto3, con le dimensioni degli oggetti e la concorrenza riportate. Non è indicato alcun file sorgente o test; il lavoro è concluso quando si determina se il divario è previsto e si documenta qualsiasi ottimizzazione o spiegazione supportata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- Python
- Stelle
- 474
- Fork
- 321
- Merge medio
- 23m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/oci-python-sdk
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/oci-python-sdk#890 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/oci-python-sdk#879 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
oracle/oci-python-sdk#878 ·
-
SDK
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
oracle/oci-python-sdk#861 · 5 commenti ·
-
SDK
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
oracle/oci-python-sdk#852 ·
Tutte le issue di oracle/oci-python-sdk
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·