Genieacs-* starting 2 processes using systemd

Hi all,

I am experiencing something curious on my installation. I am using Ubuntu 22.04.
I have installed genieacs and everything is working… almost fine.
I noticed that genieacs-fs, genieacs-ui, genieacs-nbi, and genieacs-cwmp are starting 2 processes instead of 1. I couldn’t find anything unusual within the systemd scripts, symbolic links, and configuration scripts.

Have someone seen this before? Could someone assist to resolve?

CWMP:
● genieacs-cwmp.service - GenieACS CWMP
Loaded: loaded (/etc/systemd/system/genieacs-cwmp.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-08-24 10:56:51 AEST; 7s ago
Main PID: 13676 (node)
Tasks: 25 (limit: 1101)
Memory: 104.6M
CPU: 803ms
CGroup: /system.slice/genieacs-cwmp.service
├─13676 node /usr/bin/genieacs-cwmp
├─13683 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-cwmp
└─13684 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-cwmp

Aug 24 10:56:51 genieacs systemd[1]: Started GenieACS CWMP.
Aug 24 10:56:51 genieacs genieacs-cwmp[13676]: 2023-08-24T00:56:51.367Z [INFO] genieacs-cwmp starting; pid=13676 version=“1.2.9+20220822165235”
Aug 24 10:56:51 genieacs genieacs-cwmp[13676]: 2023-08-24T00:56:51.926Z [INFO] Worker listening; pid=13684 address=“XX.XX.XX.XX” port=7547
Aug 24 10:56:51 genieacs genieacs-cwmp[13676]: 2023-08-24T00:56:51.927Z [INFO] Worker listening; pid=13683 address=“XX.XX.XX.XX” port=7547

FS:
● genieacs-fs.service - GenieACS FS
Loaded: loaded (/etc/systemd/system/genieacs-fs.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-08-24 10:52:16 AEST; 13min ago
Main PID: 13535 (node)
Tasks: 33 (limit: 1101)
Memory: 68.7M
CPU: 1.243s
CGroup: /system.slice/genieacs-fs.service
├─13535 node /usr/bin/genieacs-fs
├─13542 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-fs
└─13543 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-fs

Aug 24 10:52:16 genieacs systemd[1]: genieacs-fs.service: Deactivated successfully.
Aug 24 10:52:16 genieacs systemd[1]: Stopped GenieACS FS.
Aug 24 10:52:16 genieacs systemd[1]: Started GenieACS FS.
Aug 24 10:52:16 genieacs genieacs-fs[13535]: 2023-08-24T00:52:16.531Z [INFO] genieacs-fs starting; pid=13535 version=“1.2.9+20220822165235”
Aug 24 10:52:17 genieacs genieacs-fs[13535]: 2023-08-24T00:52:17.074Z [INFO] Worker listening; pid=13543 address=“::” port=7567
Aug 24 10:52:17 genieacs genieacs-fs[13535]: 2023-08-24T00:52:17.076Z [INFO] Worker listening; pid=13542 address=“::” port=7567

NBI:
● genieacs-nbi.service - GenieACS NBI
Loaded: loaded (/etc/systemd/system/genieacs-nbi.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-08-24 10:52:15 AEST; 13min ago
Main PID: 13502 (node)
Tasks: 33 (limit: 1101)
Memory: 78.2M
CPU: 1.276s
CGroup: /system.slice/genieacs-nbi.service
├─13502 node /usr/bin/genieacs-nbi
├─13509 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-nbi
└─13510 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-nbi

Aug 24 10:52:15 genieacs systemd[1]: genieacs-nbi.service: Deactivated successfully.
Aug 24 10:52:15 genieacs systemd[1]: Stopped GenieACS NBI.
Aug 24 10:52:15 genieacs systemd[1]: genieacs-nbi.service: Consumed 1.051s CPU time.
Aug 24 10:52:15 genieacs systemd[1]: Started GenieACS NBI.
Aug 24 10:52:15 genieacs genieacs-nbi[13502]: 2023-08-24T00:52:15.363Z [INFO] genieacs-nbi starting; pid=13502 version=“1.2.9+20220822165235”
Aug 24 10:52:15 genieacs genieacs-nbi[13502]: 2023-08-24T00:52:15.894Z [INFO] Worker listening; pid=13509 address=“::” port=7557
Aug 24 10:52:15 genieacs genieacs-nbi[13502]: 2023-08-24T00:52:15.895Z [INFO] Worker listening; pid=13510 address=“::” port=7557

UI:
● genieacs-ui.service - GenieACS UI
Loaded: loaded (/etc/systemd/system/genieacs-ui.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-08-24 10:50:49 AEST; 15min ago
Main PID: 13370 (node)
Tasks: 33 (limit: 1101)
Memory: 109.1M
CPU: 3.225s
CGroup: /system.slice/genieacs-ui.service
├─13370 node /usr/bin/genieacs-ui
├─13377 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-ui
└─13378 /usr/local/lib/node/nodejs/bin/node /usr/bin/genieacs-ui

Aug 24 10:50:49 genieacs systemd[1]: genieacs-ui.service: Deactivated successfully.
Aug 24 10:50:49 genieacs systemd[1]: Stopped GenieACS UI.
Aug 24 10:50:49 genieacs systemd[1]: genieacs-ui.service: Consumed 5min 36.448s CPU time.
Aug 24 10:50:49 genieacs systemd[1]: Started GenieACS UI.
Aug 24 10:50:49 genieacs genieacs-ui[13370]: 2023-08-24T00:50:49.531Z [INFO] genieacs-ui starting; pid=13370 version=“1.2.9+20220822165235”
Aug 24 10:50:50 genieacs genieacs-ui[13370]: 2023-08-24T00:50:50.268Z [INFO] Worker listening; pid=13377 address=“::” port=3000
Aug 24 10:50:50 genieacs genieacs-ui[13370]: 2023-08-24T00:50:50.269Z [INFO] Worker listening; pid=13378 address=“::” port=3000

either you are using variables as mentioned in the doc or, more likely, your cpu has only 2 cores (a virtual machine?).

lscpu -a |head

Thank you, however, the problem remains.

cat /opt/genieacs/genieacs.env

GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log
GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log
GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log
GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log
GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml
NODE_OPTIONS=–enable-source-maps
GENIEACS_EXT_DIR=/opt/genieacs/ext
GENIEACS_UI_JWT_SECRET=
GENIEACS_CWMP_INTERFACE=XX.XX.XX.XX
GENIEACS_CWMP_PORT=7547
NBI_WORKER_PROCESSES=1
FS_WORKER_PROCESSES=1
UI_WORKER_PROCESSES=1
CWMP_WORKER_PROCESSES=1

lscpu | head

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 40 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Vendor ID: AuthenticAMD
Model name: Common KVM Processor v2.0
CPU family: 6
Model: 58

that’s the culprit

those too. strange, I don’t remember those being set during installation.

Could you please elaborate? It is only 1 CPU, so I’d expect one process only per service.

as per doc same link as before:

CWMP_WORKER_PROCESSES

The number of worker processes to spawn for genieacs-cwmp. A value of 0 means as many as there are CPU cores available.

Default: 0

The problem remains after removing *_WORKER_PROCESSES=1 from the config file.
I still can’t find anything unusual.
There’s one CPU only, it doesn’t make any sense running 2 processes instead of 1.

Absolutely it does. When I thread out, I’ve found threading 2-4x the CPU count to give me the best performance benefits, depending on workload.

1 Like

I understand, however, there isn’t a massive workload. It is just one device, and 2 or 3 presets and provision scripts. My concern is because I’ve seen each one of both processes running a different version of the same external script. It might be a bug then as I’ve had to restart the genieacs-cwmp service (systemctl restart genieacs-cwmp) to synchronize them. If it is a bug, in large scale could become a big problem. In addition to that, all logs were duplicated as well - I’ve checked /var/log/genieacs/genieacs-cwmp-access.log
Thank you for all your help. I’ll report the bug if I reproduce it again.

If you make changes to external scripts you must restart the cwmp process. This is by design as the script gets cached on first use (for each thread).

1 Like

There you go! I didn’t know about it. Case closed. Thanks for your help @akcoder.