# GenieACS GUI slow loading Devices Tab

**URL:** <https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194>\
**Category:** Uncategorized\
**Created:** [November 8, 2020, 7:30pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194 "2020-11-08T19:30:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![giuseppe](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@giuseppe](https://forum.genieacs.com/u/giuseppe)\
**Post date:** [November 8, 2020, 7:30pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/1 "2020-11-08T19:30:57Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [November 11, 2020, 6:49am UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/2 "2020-11-11T06:49:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![giuseppe](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@giuseppe](https://forum.genieacs.com/u/giuseppe)\
**Post date:** [November 11, 2020, 9:36am UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/3 "2020-11-11T09:36:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [November 11, 2020, 5:06pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/4 "2020-11-11T17:06:08Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![giuseppe](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@giuseppe](https://forum.genieacs.com/u/giuseppe)\
**Post date:** [November 11, 2020, 6:30pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/5 "2020-11-11T18:30:00Z")

</div>

Thank you @akcoder for your answer.

My GenieACS configuration is very simple.

I have 4 presets:

 ![prese](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/1498643e874c82bd05909859a52742d9af9457b8.jpeg)

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?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [November 11, 2020, 7:06pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/6 "2020-11-11T19:06:40Z")

</div>

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:

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

```

Should be:

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

```

As the path `Device.ManagementServer.ConnectionRequestUsername` is never going to change 😃.

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

```auto
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:

```auto
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:

```auto
// 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});

```

---

<div class="post-metadata">

**Author:** ![giuseppe](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@giuseppe](https://forum.genieacs.com/u/giuseppe)\
**Post date:** [November 11, 2020, 10:31pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/7 "2020-11-11T22:31:01Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [November 11, 2020, 10:53pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/8 "2020-11-11T22:53:30Z")

</div>

> [@akcoder](#):
>
> `Plus, there really isn't a need to have both an inform interval and inform time`

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.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [November 11, 2020, 10:54pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/9 "2020-11-11T22:54:58Z")

</div>

> [@giuseppe](#):
>
> I’ve checked the JSON loaded when I go into “Devices” tab, and I still can see **tons of properties** …

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

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [November 11, 2020, 11:07pm UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/10 "2020-11-11T23:07:17Z")

</div>

> [@zaidka](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![giuseppe](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@giuseppe](https://forum.genieacs.com/u/giuseppe)\
**Post date:** [November 12, 2020, 12:18am UTC](https://forum.genieacs.com/t/genieacs-gui-slow-loading-devices-tab/1194/11 "2020-11-12T00:18:28Z")

</div>

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…
