Inside the system: resources, kernel, processes / Stage 4 of 12 · step 8 of 10
A service fails under load
Situation
The lab-notify service — the notify-hub application — sends notifications for the intranet portal. Every
open portal page subscribes to /events and keeps a connection to the service. While there were a few dozen
subscribers, the service worked. Today there are about three hundred, and the service works one moment and
fails the next: curl http://127.0.0.1:8090/health answers Connection refused every other time. Yesterday a
colleague already changed the service settings — it did not help.
On this machine the subscribers are played by the lab-subscribers service: it keeps 300 subscriptions open
and reconnects the dropped ones.
Task
lab-notifyholds 1000 subscribers at once: it answerscurl http://127.0.0.1:8090/healthand does not restart. The application code stays the same.- Change the service settings in a drop-in. Do not edit the packaged unit
/usr/lib/systemd/system/lab-notify.serviceor replace it with a copy: the next package update would overwrite it. systemd-analyze verify lab-notify.serviceprints nothing.- The service holds the same load after a restart:
sudo systemctl restart lab-notify.
There is no internet on the machine; everything you need is already installed. Run administrative commands with
sudo.
Lab goals
0 of 4-
lab-notify holds 1000 subscribers, answers /health and does not restart; the application code is unchanged — not checked yet
-
The setting lives in a drop-in of the service, the packaged unit is unchanged, and the process runs with it — not checked yet
-
systemd-analyze verify lab-notify.service prints nothing — not checked yet
-
The service holds the same load after a restart — not checked yet