melmothx / amusewiki

Text::Amuse-based publishing platform
https://amusewiki.org
Other
174 stars 26 forks source link

Changing the AMW_WORKERS variable does not affect the perl-fcgi-pm process #410

Closed rojenzaman closed 1 year ago

rojenzaman commented 1 year ago

In either installation (package or git), setting AMW_WORKERS as an environment variable does not affect the process count.

outputs:

$ env | grep AMW_WORKERS
AMW_WORKERS=3
$ pstree
systemctl─┬─amusewiki-jobbe───perl
          ├─nginx───3*[nginx]
          └─perl-fcgi-pm───5*[perl-fcgi]
$ ps aux |grep 'perl-fcgi'
amusewi+    27  2.0  5.4 247868 211708 ?       Ss   18:51   0:02 perl-fcgi-pm
amusewi+    39  0.0  5.1 247868 201540 ?       S    18:51   0:00 perl-fcgi
amusewi+    44  0.0  5.1 247868 201404 ?       S    18:51   0:00 perl-fcgi
amusewi+    45  0.0  5.1 247868 201368 ?       S    18:51   0:00 perl-fcgi
amusewi+    46  0.0  5.1 247868 201368 ?       S    18:51   0:00 perl-fcgi
amusewi+    47  0.0  5.1 247868 201368 ?       S    18:51   0:00 perl-fcgi

How can I solve this?

melmothx commented 1 year ago

The AMW_WORKERS environment variable affects only the number of process set by script/init-fcgi.pl (called by init-all.sh). If started from systemd, you need to override the service file, which has the number of processes on the command line:

ExecStart=/usr/bin/plackup -s FCGI --listen /var/lib/amusewiki/amusewiki.socket --nproc 5 -E deployment /usr/share/perl5/AmuseWikiFarm/psgi/amusewiki.psgi
rojenzaman commented 1 year ago

Thanks for explaining.