Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow Tile Loading #1135

Open
wildintellect opened this issue Nov 4, 2024 · 5 comments
Open

Slow Tile Loading #1135

wildintellect opened this issue Nov 4, 2024 · 5 comments
Assignees
Labels
MSFC MSFC related issues

Comments

@wildintellect
Copy link
Collaborator

Describe the bug
@lduncanson @pahbs are reporting that visualizations using MAAP titiler seem to be much slower than a couple of months ago

To Reproduce
Load up the map in this notebook.
https://notebooksharing.space/view/68349c623d52dea574975392ac86b9772c2f375f7883d33bf8a4865b9b9e6f46#displayOptions=hide-inputs

Expected behavior
Faster tile loading

Additional context
@pahbs can you provide the full source code for the notebook and embedded functions so we can more easily debug?

@wildintellect
Copy link
Collaborator Author

wildintellect commented Nov 4, 2024

Things to check:

  1. The age of this mosaic (how recently was it created)
  2. The formatting of the tiles in the mosaic
  3. Any performance configuration changes to the Titiler deployment with the recent upgrade

Note:

  • current performance is roughly 20s per tile at zoom 6
  • zoom 9 is around 5-10s

@wildintellect
Copy link
Collaborator Author

wildintellect commented Nov 4, 2024

COGs seems ok - there is a known quirk around the custom projection slowing, but unless that changed in the recent update I don't see how that would cause this.

Driver: GTiff
File: s3://maap-ops-workspace/.../boreal_ht_2020_202407251721976367_0000357.tif
COG: True
Compression: DEFLATE
ColorSpace: None

Profile
    Width:            3000
    Height:           3000
    Bands:            2
    Tiled:            True
    Dtype:            float32
    NoData:           nan
    Alpha Band:       False
    Internal Mask:    False
    Interleave:       PIXEL
    ColorMap:         False
    ColorInterp:      ('gray', 'undefined')
    Scales:           (1.0, 1.0)
    Offsets:          (0.0, 0.0)

Geo
    Crs:              PROJCS["unnamed",GEOGCS["GRS 1980(IUGG, 1980)",DATUM["unknown",SPHEROID["GRS80",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["latitude_of_center",40],PARAMETER["longitude_of_center",180],PARAMETER["standard_parallel_1",50],PARAMETER["standard_parallel_2",70],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]
    Origin:           (-1791478.0000000047, 7623304.000000009)
    Resolution:       (30.0, -30.0)
    BoundingBox:      (-1791478.0000000047, 7533304.000000009, -1701478.0000000047, 7623304.000000009)
    MinZoom:          6
    MaxZoom:          11

Image Metadata
    AREA_OR_POINT: Area
    OVR_RESAMPLING_ALG: NEAREST

Image Structure
    COMPRESSION: DEFLATE
    INTERLEAVE: PIXEL
    LAYOUT: COG

Band 1
    Description: lyr1
    ColorInterp: gray

Band 2
    Description: sd
    ColorInterp: undefined

IFD
    Id      Size           BlockSize     Decimation           
    0       3000x3000      256x256       0
    1       1500x1500      256x256       2
    2       750x750        256x256       4
    3       375x375        256x256       8
    4       188x188        256x256       16

@wildintellect
Copy link
Collaborator Author

wildintellect commented Nov 4, 2024

@wildintellect wildintellect added the MSFC MSFC related issues label Nov 4, 2024
@wildintellect
Copy link
Collaborator Author

5-6 seconds seems to be the fastest speed possible with this particular tile set that has a custom WKT defined CRS. If speed is important we can consider alternate methods of storing the data for visualization once a dataset is ready to move beyond initial results into something for distribution.

This could include:

  • enabling caching
  • creating higher level overviews, internal or external (zoom 6 is about 20x20 pixels from an original tile - you need about 164 tiles per 1 256x256 jpg/png)
  • saving a copy of the data in a projection that's faster in Titiler

@hrodmn
Copy link

hrodmn commented Nov 7, 2024

It doesn't explain the change in performance, but these tifs are Float32 and in an Albers projection so the tiler has to do a fair bit of work and load a lot of data in order to render a tile. I will try converting one of these files to an Int data type to see what impact the data type might be having here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MSFC MSFC related issues
Projects
None yet
Development

No branches or pull requests

3 participants