Select to view content in your preferred language

Upgrade from 4.16 to 4.22; 2000+ FeatureLayer requests on startup

2382
14
03-14-2022 10:37 AM
LucasScharenbroich
Frequent Contributor

I recently updated an internal application from JSAPI 4.16 to 4.22 to evaluate the memory and performance improvements in the Feature Layers. 

After the update, the application first off over 2,000 requests to the various Feature Layers, which results in a load time of over 3 minutes. The volume of services requests results in several hundred returning `ERR_INSUFFICIENT_RESOURCES` from the ArcGIS Server, too.

Our application loads a Webmap by ID from ArcGIS Online and creates about 20 stand-alone FeatureLayer objects that are used for querying that are not added to the map during start up.

It appears that many of the requests are for the gridded query strategy (different, sequential bounding boxes) of the Feature Layers, which I can understand, but didn't expect the volume of queries or such different startup behavior from 4.16.

Looking for advice on what approach I can take to isolate and control the amount of queries made by the FeatureLayer class and if there are any specific behaviors of the FeatureLayer that we should be aware of in the jump from 4.16 to 4.22 that might be exacerbating this issue.

Note: I have reviewed the Breaking Changes information and the Release Notes in general, but did not pick up any anything specific from those sources.

Tags (3)
0 Kudos
14 Replies
KristianEkenes
Esri Regular Contributor

Do you have an app you can share so we can debug? It may also be worth reaching out to Esri support. They can set up a reproducible case so you don't share your data (if it's private) and submit a bug report to us so we can properly debug.

0 Kudos
mgeorge
Esri Contributor

Yes like @KristianEkenes mentioned, if you can provide us a repro, we can take a look. I'm not aware of why it would be making more requests, all of the layers are AGOL hosted? 

0 Kudos
LucasScharenbroich
Frequent Contributor

The layers are on an ArcGIS Server, not hosted.  I'll try to create a reduced test case of the application that triggers the behavior.

0 Kudos
mgeorge
Esri Contributor

@LucasScharenbroich do you know what version of server?

0 Kudos
mgeorge
Esri Contributor

Another thing that you can also try is disabling PBF mode: Disable PBF (codepen.io)

0 Kudos
LucasScharenbroich
Frequent Contributor

The app is built using ESM/Typescript and bundled with webpack.  My understanding is that the dojo loader is not used in this case and setting the `dojoConfig` global as shown in that codepen example did not seem to have any effect.

Is there an alternate way of setting that flag using ESM/TS?

0 Kudos
LucasScharenbroich
Frequent Contributor

10.6

0 Kudos
mgeorge
Esri Contributor

I can check whether or not this is the case if I can see what's going on, but upgrading your server to something more recent might also help here. I know there were some PBF issues for earlier version of server... that's the only major difference in terms of querying for server that I can think of ATM. 

0 Kudos
mgeorge
Esri Contributor

@LucasScharenbroich for the flag, just use esriConfig instead of dojoConfig. 

0 Kudos