CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.8k stars 3.46k forks source link

Support multiple 3dtiles url #8742

Closed sazima closed 4 years ago

sazima commented 4 years ago

When I was testing, the loading of 3dtiles was limited by the browser, and only 6 requests could be concurrent at a time.

WX20200410-090819@2x.png

Can I support the following code to improve the request speed?

let url = ['http://t1.xxxx.com/3dmaps/Production_2.json', 'http://t2.xxxx.com/3dmaps/Production_2.json', 'http://t3.xxxx.com/3dmaps/Production_2.json', 'http://t4.xxxx.com/3dmaps/Production_2.json']
new Cesium3DTileset({
     url
    })

Thanks!

OmarShehata commented 4 years ago

The maximum number of concurrent requests is limited by the browser. More concurrent requests doesn't necessary mean a faster application, see Kevin's write up on this here: https://github.com/CesiumGS/cesium/pull/8549#issuecomment-575842684 and the general 3D Tiles request scheduler issue here https://github.com/CesiumGS/cesium/issues/5509.

Your code snippet implies you're trying to load multiple 3D Tilesets in your scene. You can do this by making one new Cesium3DTileset call for each URL.

If you're still having issues in your app feel free to start a thread on the Cesium community: https://community.cesium.com/.

lilleyse commented 4 years ago

Also RequestScheduler will be part of the public API in 1.69 which gives more control over the number of concurrent requests.

Specifically look at RequestScheduler.maximumRequestsPerServer. You can check out the documentation here: http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/master/Build/Documentation/RequestScheduler.html

mramato commented 4 years ago

FYI, the actual concurrent request limit depends on the browser (Chrome uses 6) and the limit is also per-server (there is an additional overall limit of 10 for the page in Chrome I believe).

These limits go away or are much higher if HTTP/2 servers are used.

sazima commented 4 years ago

Thanks. Using `RequestScheduler' and HTTP/2 helped me a lot .