You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have many vector tile sources present on the map then animations can send out a huge number of concurrent requests, potentially overwhelming the browser and throwing ERR_INSUFFICIENT_RESOURCES errors which don't get retried by mapbox resulting in missing tiles. More seriously it can disrupt all other concurrent requests being sent out by the browser.
I think this is also related to some of the problems outlined by #13208
I've looked into how OpenLayers handles raster tile loading, and I believe the reason why their equivalent is fast is that they use a TileQueue data structure that makes sure there are never more than 16 tiles loading in parallel or requested at once in one frame. This makes it avoid requesting short-lived tiles that e.g. get requested on zoom in near the borders of the map and then immediately go off the view when zooming further during an animation. This might be a possible solution to this feature request #5482, and we should definitely explore a similar approach.
I'm wondering if such a thing could be added for vector sources too? Though maybe 16 is too conservative a number for vector tiles
Mock-Up
It would be nice to expose a variable similar to the existing mapboxgl.maxParallelImageRequests , but applying to vector tiles rather than images. e.g. mapboxgl.maxParallelVectorTileRequests
The text was updated successfully, but these errors were encountered:
jobblefrobble
changed the title
Allow limiting number of concurrent tile requests
Allow limiting number of concurrent vector tile requests
Jul 2, 2024
I've started work on this in a fork, will aim to put out a PR sometime soon, though will likely need guidance around using config values within workers and how best to test it 🙂
Motivation
If you have many vector tile sources present on the map then animations can send out a huge number of concurrent requests, potentially overwhelming the browser and throwing
ERR_INSUFFICIENT_RESOURCES
errors which don't get retried by mapbox resulting in missing tiles. More seriously it can disrupt all other concurrent requests being sent out by the browser.I think this is also related to some of the problems outlined by #13208
Design Alternatives
There was talk of a
TileQueue
on #6643 :I'm wondering if such a thing could be added for vector sources too? Though maybe 16 is too conservative a number for vector tiles
Mock-Up
It would be nice to expose a variable similar to the existing
mapboxgl.maxParallelImageRequests
, but applying to vector tiles rather than images. e.g.mapboxgl.maxParallelVectorTileRequests
The text was updated successfully, but these errors were encountered: