53/53
Sign inSign up free

842. Limit CPU, Memory and Processes in Compose

medium 20 XP ~9 minHands-on lab

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.

Task

In /home/student/projects/recommender/compose.yaml, set:

ServiceCPU limitMemory limitMemory reservationOther
api1 CPU512 MB256 MB
worker0.5 CPU256 MBat 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

TerminalNot started

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.