Inside the system: resources, kernel, processes / Stage 2 of 12 · step 8 of 9
A build runs out of memory
Not running
Starting
Situation
Every night the lab-build.timer timer starts the search index build of the docs site — the lab-build
service. The build is given 192 MiB of RAM: the site and the database need the rest. There are more pages now,
and the index has not been updated for several nights in a row. The build can be started in the daytime too:
sudo systemctl start lab-build.
The build cannot be given more RAM. The decision is to give the machine swap: whatever does not fit into 192 MiB goes to the disk — the build runs slower, but it finishes.
Task
- The swap is a file of exactly 512 MiB, and it is on. Process memory ends up in swap, so only root may read and write the file (mode 600).
- After a reboot the swap comes on by itself, and the swap lines in
/etc/fstabcause no errors at boot. - The system is reluctant to send memory to swap:
vm.swappiness= 10 now and after a reboot, and the setting is written as a file in/etc/sysctl.d. - The
sudo systemctl start lab-buildbuild passes — the check will start it itself. Do not change the build unit or its memory limit.
The machine has no internet access; the programs you need are already installed.
Lab goals
0 of 4-
A swap file of exactly 512 MiB is on, owned by root with mode 600 — not checked yet
-
The swap file is listed in /etc/fstab, and there are no swap lines for files that do not exist — not checked yet
-
vm.swappiness = 10 now and after a reboot, from a file in /etc/sysctl.d — not checked yet
-
The nightly lab-build build passes within the same 192 MiB memory limit — not checked yet
Hints
0 of 3 open · they open one at a time
Hint 1
Show the solution
after 3 failed checks