Limit CPU, Memory and Processes in Compose
Labs have no container engine, so nothing is started: your files are checked with docker-compose config.
Last night the worker of recommender leaked memory until the host's OOM killer started killing random processes, the API included.
In /home/student/projects/recommender/compose.yaml, set:
| Service | CPU limit | Memory limit | Memory reservation | Other |
|---|---|---|---|---|
api | 1 CPU | 512 MB | 256 MB | |
worker | 0.5 CPU | 256 MB | at most 100 processes; open files limited to 4096 (soft and hard) |
(MB here means MiB: 512 MB = 536870912 bytes.) Keep images, ports and commands.
About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.