Replies: 1 comment 4 replies
-
First, this is a huge mosaic and using mosaicJSON in a static file (.json) might not be the best here. For this kind of mosaic I usually use DynamoDB storage (sadly it's not well documented in detail). I'm not sure how are your COG are but usually if they are About performance, you can also try running without using multi thread
You can also set If your data is openly available I could have a deeper look. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to get ideas on how to improve the performance of tile requests for a large MosaicJSON config file (37 MB .json; 842 KB .json.gz) with ~150K quadkey tiles. I generated the config file using the
cogeo-mosaic
CLI with ~950 COG URLs worth over 75 TBs in total (continental US coverage).I initially tried serving COG files located on a large NFS storage appliance directly from TiTiler to a MapProxy server for caching, where the MapProxy config file contained ~950 sources with URLs like:
https://titiler.example.com/cog/tiles/%(z)s/%(x)s/%(y)s.%(format)s?url=file:///path/to/cog/file.tif
. The performance was quite decent, even when MapProxy saw all cache misses:Here are some average response times for a tile at different zooms. For each tile, MapProxy would be making multiple source requests to TiTiler, and then merging the pieces together.
Then I decided to try MosaicJSON by moving the exact same set of ~950 MapProxy sources into the MosaicJSON config, thereby reducing the MapProxy config to a single source with a URL like:
https://titiler.example.com/mosaicjson/tiles/%(z)s/%(x)s/%(y)s.%(format)s?url=file:///path/to/mosaic.json.gz
.Although, this time, again without cache hits, the tile requests are timing out left and right, especially at zooms lower than 6:
Around the same time, I see in the TiTiler logs plenty of
[CRITICAL] WORKER TIMEOUT
errors followed by[INFO] Started server process
. I'm running TiTiler in a cluster of up to 10 pods, each getting up to 64 GB and 16 CPUs, so they're definitely no slouch. I see most pods are currently using >90% of their 64 GB limit, but there's definitely also heavy CPU usage during MosaicJSON handling. Even when processing stops—mostly by failure—and CPU usage settles, the pods still show >80% of their memory limit.I understand that I've shifted all of the source merging burden from MapProxy onto TiTiler, but I don't understand why the performance turned so bad as it should be reading the same number of underlying COGs. I also have way more pods and resources allocated to TiTiler than I have to MapProxy.
Beta Was this translation helpful? Give feedback.
All reactions