Linux Labs

Inside the system: resources, kernel, processes / Stage 4 of 12 · step 8 of 10

A service fails under load

medium ~25 min
Not running Starting usually ~20 s
Report a problem

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

  1. lab-notify holds 1000 subscribers at once: it answers curl http://127.0.0.1:8090/health and does not restart. The application code stays the same.
  2. Change the service settings in a drop-in. Do not edit the packaged unit /usr/lib/systemd/system/lab-notify.service or replace it with a copy: the next package update would overwrite it.
  3. systemd-analyze verify lab-notify.service prints nothing.
  4. 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.

Visible only to you. Saved as you type.

All notes

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

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…