High cpu usage on wmtslayer with geoserver in scene

758
5
08-20-2023 04:39 AM
gogo
by
New Contributor

I have wmtslayer with geoserver v2.22.1 

when i use it on scene as basemap , it has high cpu usage when fast zooming by mouse wheel to very zoomed levels.

But it's ok on 2d and in the map view.

i use qt sdk 100.15.0 and qt 5.15.2 msvc19

 

here is my code from BasicSceneView example.

import QtQuick 2.6
import QtQuick.Controls 2.2
import Esri.ArcGISRuntime 100.15

Rectangle {
width: 800
height: 600

readonly property url wmtsServiceUrl: "http://localhost:8080/geoserver/gwc/service/wmts/1.0.0/"
property WmtsService service;


SceneView {
anchors.fill: parent


Component.onCompleted: {
// Set the focus on SceneView to initially enable keyboard navigation
forceActiveFocus();
createWmtsLayer();
}

Scene {
id: scene

}
}

function createWmtsLayer() {
service = ArcGISRuntimeEnvironment.createObject("WmtsService", { url: wmtsServiceUrl });

// connect to loadStatusChanged signal of the service
service.loadStatusChanged.connect(()=> {
if (service.loadStatus === Enums.LoadStatusLoaded) {
const serviceInfo = service.serviceInfo;
const layerInfos = serviceInfo.layerInfos;
const layerId = layerInfos[5].wmtsLayerId;
console.log("layer", layerId)
const wmtsLayer = ArcGISRuntimeEnvironment.createObject("WmtsLayer", {
url: wmtsServiceUrl,
layerId: layerId,
maxScale: 8000,
minScale: 2000
});
wmtsLayer.wmtsLayerId = layerId
const basemap = ArcGISRuntimeEnvironment.createObject("Basemap");
basemap.baseLayers.append(wmtsLayer);

scene.basemap = basemap

}
});

service.load();
}

}

0 Kudos
5 Replies
KoushikHajra
Esri Contributor

Hello @gogo ,

Thank you for reaching out to us with your problem. We made some improvements related to high CPU usage in the scene view in version 100.15.2. Is it possible for you to upgrade to that version? Please let us know if you are able to do that. 

Also, please be advised that CPU usage in general is slightly higher in 3D when interacting with the view. However, it should come down when idling. Is this causing any significant impact for you in your workflows? If  so, please share that information with us. 

Regards,
Koushik 

0 Kudos
gogo
by
New Contributor

Thank for your reply 

I updated to 100.15.2 , but the problem still exists.

The problem is not just hight cpu usage, but it cause cpu stuck around 90-98 percent on corei7-9700k.

It's ok when i use esri online map servers in the scene, the problem is appeared when using my own geoserver map server and only when i select a region and turn mouse wheel on that point until very zoomed levels.

I attached a video from what i do and the problem.

 

0 Kudos
KoushikHajra
Esri Contributor

Hello,

Thank you for trying out the newer version and sorry to hear that it didn't really help much. I couldn't tell from your video if the tiles ever come back and finish drawing or if they are stuck from that point on. In any case, I have a few follow up questions for you:

1. When you say that it works when using arcgis online, are you using the same data in online and your geoserver? If so, it almost does not feel like a client issue. It feels like the server is not able to keep up with the request cancellations and new requests. 

2. Can you please check in fiddler to see if the requests are being cancelled and then tiles are requested as you keep zooming in? You can compare online and your geoserver to see the differences. Those might provide some clue as to what could be going on.

3. Do the tiles ever come back when hosting from a geoserver or they get stuck and never finish drawing?

4. Is it possible to share your data that's hosted on your geoserver? That would be the next step since without actually using a data, it's hard to tell what is happening.

Having said all that, it is expected that CPU usage would be high when you zoom in fast to an area. However, it should complete the last request and then the tiles do come back and draw and at that point, the usage should come down a bit. 

Please let me know and we can move forward based on your responses.

0 Kudos
alardodegrini
New Contributor

Hello,

I had the same problem, the high cpu usage was solved by setting noDataTileBehavior to Enums.NoDataTileBehaviorBlank.

But the new problem is when zooming to end, its go beyond the earth and show the sky.

It seems on end zoom level your server does not have tiles and the sdk try to sampling , because the default value of noDataTileBehavior is NoDataTileBehavior::UpSample.

 

KoushikHajra
Esri Contributor

That is great information. We can look into our end to see if we can do any optimizations when there is no tiles and we're trying to resample. Again, thank you for that information. 

0 Kudos