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

Load PMTiles tiles faster #50

Open
nielsbom opened this issue Jun 3, 2024 · 4 comments
Open

Load PMTiles tiles faster #50

nielsbom opened this issue Jun 3, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@nielsbom
Copy link
Collaborator

nielsbom commented Jun 3, 2024

Cloudflare is serving the PMTiles tiles.

But we notice that the tiles can be slow to load.

Investigate and improve how fast those tiles are served.

@nielsbom
Copy link
Collaborator Author

nielsbom commented Jun 3, 2024

We've configured Cloudflare to cache requests, which you can see when doing the same request twice:

time curl -I 'https://tiles.queeringthemap.com/basemap/11/1240/1031.mvt'

First time:

HTTP/2 200
date: Mon, 03 Jun 2024 19:50:04 GMT
content-type: application/x-protobuf
content-length: 4478
cache-control: max-age=86400
vary: Origin
server: cloudflare
cf-ray: 88e235b78847b930-AMS


________________________________________________________
Executed in    3.43 secs      fish           external
   usr time   17.27 millis   94.00 micros   17.17 millis
   sys time    8.09 millis  528.00 micros    7.57 millis

Second time:

HTTP/2 200
date: Mon, 03 Jun 2024 19:50:07 GMT
content-type: application/x-protobuf
content-length: 4478
cf-ray: 88e235d90dad0a6b-AMS
cf-cache-status: HIT
accept-ranges: bytes
age: 3
cache-control: max-age=86400
last-modified: Mon, 03 Jun 2024 19:50:04 GMT
vary: Origin
server: cloudflare


________________________________________________________
Executed in  125.83 millis    fish           external
   usr time   11.91 millis    0.07 millis   11.84 millis
   sys time    7.77 millis    1.30 millis    6.47 millis

The first time is quite slow: 3.43 seconds, the cached URL is only 0.125 seconds.

@jokroese
Copy link
Member

jokroese commented Jun 5, 2024

Great to have caching – 0.125 seconds is flying!

@jokroese
Copy link
Member

jokroese commented Jun 5, 2024

Instinctively 3.4 seconds seems slow (and, as we've discussed, feels slow too). Could you do a comparison to the PMTiles from the Protomaps organisation (e.g. https://maps.protomaps.com/) and also MapTiler? That can give us a baseline for what we can hope to aim for.

@nielsbom
Copy link
Collaborator Author

nielsbom commented Jun 6, 2024

Agreed on the slowness.

With a lot of traffic I also think we'd be hitting the cache a lot. But that's quite handwavey.

@jokroese jokroese changed the title PMTiles tiles are loaded faster Load PMTiles tiles faster Jul 5, 2024
@jokroese jokroese added the bug Something isn't working label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants