GenieACS GUI slow loading Devices Tab

Hello everyone,

I would like to know if is there something I can do to speed up loading the Devices tab.

Using browser inspector tool, I’ve noticed the loaded URL is:
https://xxxx:3000/api/devices/?filter=true

and this request takes about 4 seconds to load.

It’s a new server, with only 2 devices, so no load at all.
I see this request load everything about each device, so even for two devices only, it’s a very long answer.

Is there something I can do to speed up this?

Your devices might have a very large data model and you’ve fetched all available parameters. That’s generally not recommended. Instead, you should set up your presets to load only the parameters you need.

1 Like

Thank you for your answer, I have only default presets, only “boot” preset is changed.
How can I check if I’m loading all info? Is it possible to change that?

What @zaidka is saying is you might be doing something like declare('InternetGatewayDevice.WANDevice.*', {value: Date.now()}); or even declare('InternetGatewayDevice.*', {value: Date.now()});

This is not what you want to do. Be more targeted in the information you retrieve from the CPE. Example:

let now = Date.now();
declare("Device.WiFi.Radio.*.PossibleChannels", {value: 1});
declare("Device.WiFi.Radio.*.OperatingFrequencyBand", {value: 1});
declare("Device.WiFi.Radio.*.Enable", {value: now});
declare("Device.WiFi.Radio.*.Channel", {value: now});
declare("Device.WiFi.Radio.*.Status", {value: now});
declare("Device.WiFi.Radio.*.AutoChannelEnable", {value: now});

I could simplify my script and just do declare("Device.WiFi.Radio.*.*", {value: now}); but that would be pulling back way more information than I actually need.

1 Like

Thank you @akcoder for your answer.

My GenieACS configuration is very simple.

I have 4 presets:

bootstrap:
const now = Date.now();
// Clear cached data model to force a refresh
clear(“Device”, now);
clear(“InternetGatewayDevice”, now);

default:
const hourly = Date.now(3600000);

// Refresh basic parameters hourly
declare("InternetGatewayDevice.DeviceInfo.HardwareVersion", {path: hourly, value: hourly});
declare("InternetGatewayDevice.DeviceInfo.SoftwareVersion", {path: hourly, value: hourly});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.MACAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.ExternalIPAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.SSID", {path: hourly, value: hourly});
// Don't refresh password field periodically because CPEs always report blank passowrds for security reasons
declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.KeyPassphrase", {path: hourly, value: 1});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.IPAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.MACAddress", {path: hourly, value: hourly});

inform:
// Device ID as user name
const username = declare(“DeviceID.ID”, {value: 1}).value[0]

// Password will be fixed a given device because Math.random() is seeded with devcie ID by default.
const password = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);

const informInterval = 7200;

// Refresh values daily
const daily = Date.now(86400000);

// Unique inform offset per device for better load distribution
const informTime = daily % 86400000;

declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: username});
declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});

declare("Device.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: username});
declare("Device.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
declare("Device.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
declare("Device.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
declare("Device.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});

My only custom preset is on “BOOT”, and all my “declare” are very specific, it’s used only to provision some parameters if there’s not a “provisioned” tag.

Which could be my issue?

So one problem I see is you are refreshing parameters paths that you don’t need to. The second parameter to a declare is how old the path can be before a GPN is performed by the ACS. Example:

declare("Device.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: username});

Should be:

declare("Device.ManagementServer.ConnectionRequestUsername", {value: 1}, {value: username});

As the path Device.ManagementServer.ConnectionRequestUsername is never going to change :smiley:.

Where the timestamp param is more useful is where you have instances that can be changed by the CPE. Example:

declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName", {path: hourly, value: hourly});

But I would question why you want to refresh the lan hosts that frequently.

So to fix your scripts:
default:

const hourly = Date.now(3600000);

/* No need to refresh this value, part of the spec is for the CPE to inform is hardware/software version */
//declare("InternetGatewayDevice.DeviceInfo.HardwareVersion", {value: 1});
//declare("InternetGatewayDevice.DeviceInfo.SoftwareVersion", {value: 1});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.MACAddress", {value: 1}); // The MAC address doesn't change hourly :D
/* Again, part of the spec is for the CPE to reports its ExternalIPAddress on change */
//declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.ExternalIPAddress", {path: hourly, value: hourly});
/* Does the user have access to change the SSID on the gateway? If so, do this: */
declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.SSID", {notification: hourly}, {value: 1});
/* Otherwise, if the SSID can only be changed via the ACS, there is no need to refresh the SSID */

/* There is no need to refresh the KeyPassphrase. The CPE is required by the spec to always return an empty string */
//declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.KeyPassphrase", {path: hourly, value: 1});

declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.IPAddress", {path: hourly, value: hourly});
declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.MACAddress", {path: hourly, value: hourly});

Inform:

// Device ID as user name
const username = declare("DeviceID.ID", {value: 1}).value[0];

// Password will be fixed a given device because Math.random() is seeded with devcie ID by default.
const password = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);

const informInterval = 7200;

// Refresh values daily
const daily = Date.now(86400000);

// Unique inform offset per device for better load distribution
const informTime = daily % 86400000;
/*
 * This doesn't work the way (I think) you think it does. This value always comes out to 62368454. Its 
 * not random. Unless you have a massive power outage, you will find overtime your CPEs via
 * entropy will automatically load balance themselves. In the case of a massive power outage,
 * things might be a little rough on start, but because of the built-in (to the CPE/spec) back off interval
 * the hit won't be quite as bad as you would think. Some CPEs are going to invariably timeout on initial
 * connection attempt, but they will keep trying until they get through
 * Plus, there really isn't a need to have both an inform interval and inform time; unless you need the CPE to inform at
 * a specific time (+/- the inform interval)
 */

declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUsername", null, {value: username});
declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPassword", null, {value: password});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnable", null, {value: true});
declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval", null, {value: informInterval});
//declare("InternetGatewayDevice.ManagementServer.PeriodicInformTime", null, {value: informTime});

declare("Device.ManagementServer.ConnectionRequestUsername", null, {value: username});
declare("Device.ManagementServer.ConnectionRequestPassword", null, {value: password});
declare("Device.ManagementServer.PeriodicInformEnable", null, {value: true});
declare("Device.ManagementServer.PeriodicInformInterval", null, {value: informInterval});
//declare("Device.ManagementServer.PeriodicInformTime", null, {value: informTime});

Thank you @akcoder for your time!
About
const informTime = daily % 86400000;
it was in the default configuration of GenieACS, I never changed that :smiley:

I’ve corrected the things you reported, but devices are still loading slowly.
I’ve checked the JSON loaded when I go into “Devices” tab, and I still can see tons of properties

How can I remove these data so GenieACS loads only what I expect it to load, to reduce loading times?

Thanks

I disagree with this. I’d say it’s recommended to set PeriodicInformTime to distribute incoming requests more evenly and avoid spikes when all devices send their periodic informs at the exact same time every time.

You may have manually refreshed all parameters when you were testing these devices. Try deleting them and let them register again.

1 Like

Interesting. Its not been my experience to have massive spikes with CPEs informing simultaneously. I’ll keep this in mind if we do have this issue.

Just tried to do so, but as I’m setting some parameters in InternetGatewayDevice.Services.VoiceService.1.VoiceProfile (it’s an AVM Fritz!Box with VoIP), it loads the entire path of InternetGatewayDevice.Services.VoiceService.1, and it’s very big, more than 100 parameters.

GenieACS shows 529 parameters (before the changes you suggested, there were 830 parameters).

Is it possible to reduce the parameters loaded in the “Devices” only?
I’ve noticed the “node” process goes to 100% until the Devices tab is loaded…