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.
Uh oh!
There was an error while loading. Please reload this page.
-
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
boto3is installed, the time to get the tiles is roughly doubled compared to whenboto3is not installed (note:titilerstill 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.tiffile.In all further steps, I have exported the following environment variables:
I have a minimal
titilerinstance, 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.pyCode for profiling
Results
minititiler.pyin a python environment which doesn't haveboto3installed (pip install titiler uvicorn):profile.py.titilerserver logs, I see onerasterio.session:boto3 not available, falling back to a DummySession.log line per requested tile.minititiler.pyin a python environment which hasboto3installed (pip install titiler uvicorn boto3):profile.py.titilerserver 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_dependencyfield from theTileFactoryto pass an already instanciatedrasterio.session.AWSSessiontotitiler'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