Replies: 2 comments 8 replies
-
Hi @glostis I've moved this to To better understand what's going on you could try setting But I think this is mostly because GDAL/rasterio will first create the AWS session and then access the file, instead of just trying to access the file directly. you can try setting |
Beta Was this translation helpful? Give feedback.
-
I haven't thoroughly read through the discussion, so apologize if my input is off point, but this issue sounded a bit like some things I stumbled upon recently: mapproxy/mapproxy#422 and opendatacube/odc-stac#115 (comment) . Perhaps there's some inspiration to be found there. Edit: Just wanted to also give a shoutout to @vincentsarago for this library. Amazing work! 🎉 |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thanks for this amazing library!
I've been trying to fine-tune the performance of
titiler
, and encountered a strange behavior.I'm not sure where exactly in the stack the problem lies — if it's at
titiler
's level, orrio-tiler
, orrasterio
. Feel free to redirect me if this is not the appropriate place to post such an issue.TL;DR
The short version is that, when trying to get tiles from a COG stored on S3, if
boto3
is installed, the time to get the tiles is roughly doubled compared to whenboto3
is not installed (note:titiler
still manages to access files on S3 withoutboto3
).This performance drop may be related to the specific setup I have (which I will describe below), but in any case I would like to have your opinion on what is going on.
Reproducing locally
I have a COG stored on a local MinIO instance at
s3://bucket/cog.tif
.Details to reproduce locally
Then go to the MinIO dashboard and upload a
cog.tif
file.In all further steps, I have exported the following environment variables:
I have a minimal
titiler
instance, defined as below, and launched withpython minititiler.py
:Code for minimal titiler
I use the below script to profile the access time to get tiles, launched with
python profile.py
Code for profiling
Results
minititiler.py
in a python environment which doesn't haveboto3
installed (pip install titiler uvicorn
):profile.py
.titiler
server logs, I see onerasterio.session:boto3 not available, falling back to a DummySession.
log line per requested tile.minititiler.py
in a python environment which hasboto3
installed (pip install titiler uvicorn boto3
):profile.py
.titiler
server logs, I see lots ofbotocore.credentials:Found credentials in environment variables.
lines (in my case, 140 lines for 50 requested tiles).boto3
? It's most certainly related to this conditional import in rasterio, but I don't understand why it impacts the performance oftitiler
.minititiler.py
, I've tried to use theenvironment_dependency
field from theTileFactory
to pass an already instanciatedrasterio.session.AWSSession
totitiler
's tiling route, but it doesn't seem to make much of a difference. Maybe I'm using it wrong?Beta Was this translation helpful? Give feedback.
All reactions