Capacity Warnings and Service Failures
When scaling to multiple concurrent containers or running demanding 3D games, containers compete for host-wide kernel resources, including process scheduling, memory, file watches, and GPU engines. This guide explains how to identify and resolve resource exhaustion, decode Work Capacity warnings, and recover failed services.
Symptoms on This Page
| What are you seeing? | Jump to Section |
|---|---|
EMFILE: Too many open files or Failed to create inotify watch errors | 1. Host-Wide Inotify Instance Exhaustion |
Game crashes on launch or loading, or logs Cannot allocate memory | 2. Host-Wide Memory Map Limits (vm.max_map_count) |
Game or application does nothing when launched, or logs Resource temporarily unavailable | 3. Container Task and PID Limits |
| Sluggish desktop, video stuttering, and audio drops under multi-container load | 4. Multi-Container Capacity and Hardware Resource Contention |
| Game crashes during loading or textures fail to render (GPU VRAM saturation) | 4. Multi-Container Capacity and Hardware Resource Contention |
| Dashboard Work Capacity panel displays an Amber or Red alert | 5. Understanding Work Capacity Indicators |
Container reports systemd state degraded or a background service fails | 6. Diagnosing and Recovering Failed Systemd Units |
1. Host-Wide Inotify Instance Exhaustion
The Linux kernel tracks inotify instance limits per real UID rather than per container. Because standard Steam Headless containers all run as UID 1000, all concurrent containers share a single host quota pool that is easily exhausted by KDE Plasma, web browsers, and Steam.
What you see
- Applications crash on launch with
EMFILE: Too many open files. - Terminal commands fail with
tail: inotify cannot be used, reverting to polling: Too many open files. - Webpack, Vite, Node.js development file watchers, or IDE tools fail to start.
- The Steam client fails to detect installed games or halts cloud synchronisation.
How to confirm this issue
Check the active host inotify limits:
sysctl fs.inotify.max_user_instances \
fs.inotify.max_user_watches \
fs.inotify.max_queued_events
Inspect kernel logs for notification allocation failures:
sudo dmesg -T | grep -i inotify
If the active fs.inotify.max_user_instances value is 128 or kernel logs show inotify allocation errors, the host quota has been exhausted.
Step-by-step resolution
Choose a suitable limit
Use these conservative minimums to leave room for the Steam Headless desktop, games, launchers, and other services using the same host quota:
| Planned concurrent containers | Recommended fs.inotify.max_user_instances |
|---|---|
| 1 container | 512 |
| 2 to 3 containers | 1024 |
| 4 to 8 containers | 3072 |
| 9 or more containers | 8192 minimum |
Raising this limit permits the kernel to allocate instances on demand without reserving memory in advance. For hosts running nine or more containers, treat 8192 as a starting baseline and monitor usage under peak load.
Configure multi-container inotify quotas
The following example configures the standard 1,024-instance default for two or three concurrent containers. Replace 1024 with the value from the table when planning a different number of containers.
- Write the sysctl configuration file on the Docker host:
printf '%s\n' 'fs.inotify.max_user_instances = 1024' | \sudo tee /etc/sysctl.d/90-steam-headless-inotify.conf >/dev/null
- Apply the setting immediately without rebooting:
sudo sysctl --load=/etc/sysctl.d/90-steam-headless-inotify.conf
- Confirm the new limit:
sysctl fs.inotify.max_user_instances
- Expected output:
fs.inotify.max_user_instances = 1024.
- Expected output:
To restore the default distribution value:
sudo rm -f /etc/sysctl.d/90-steam-headless-inotify.conf
sudo sysctl -w fs.inotify.max_user_instances=128
2. Host-Wide Memory Map Limits (vm.max_map_count)
Modern 3D games running through Proton or Wine allocate hundreds of thousands of individual virtual memory mappings, quickly exceeding the standard Linux server limit of 65,530. Because containers share the host virtual memory subsystem, this limit must be configured on the host machine.
What you see
- Games crash silently to desktop during startup or world loading without displaying in-game error dialogues.
- Wine or Proton logs output memory allocation or stack errors:
err:virtual:virtual_setup_exception stack overflow ...mprotect: Cannot allocate memory
- Games or Steam freeze or crash when loading large save files or compiling game shaders.
How to confirm this issue
Query the current memory map limit on your Docker host:
sysctl vm.max_map_count
If the returned value is less than 1048576, your host is below the baseline recommended by Valve and SteamOS for modern gaming workloads.
Step-by-step resolution
Valve SteamOS and major Linux gaming distributions configure vm.max_map_count to at least 1,048,576 (or 2,147,483,642 for extreme workloads).
- Write the persistent sysctl configuration file on your Docker host:
printf '%s\n' 'vm.max_map_count = 1048576' | \sudo tee /etc/sysctl.d/90-steam-headless-mapcount.conf >/dev/null
- Apply the setting immediately without rebooting:
sudo sysctl --load=/etc/sysctl.d/90-steam-headless-mapcount.conf
- Confirm the updated value:
sysctl vm.max_map_count
- Expected output:
vm.max_map_count = 1048576.
- Expected output:
Containers inherit vm.max_map_count directly from the host kernel. Once applied on the host, all running and future Steam Headless containers immediately benefit from the increased mapping ceiling without needing a container restart.
3. Container Task and PID Limits
Docker restricts how many Linux tasks (processes and threads) a container may create. Because desktop environments, browsers, Electron launchers, Proton, and games create hundreds of concurrent threads, an inadequate PID limit causes silent application launch failures and thread creation errors.
What you see
- The web interface displays PID limit reached beneath Container capacity on the Dashboard.
- A game, Heroic Games Launcher, web browser, or application appears to do nothing when launched.
- A game stops during startup, shader compilation, or loading without an error dialogue.
- A terminal or application log reports
fork: Resource temporarily unavailable,pthread_create failed,EAGAIN, or failure to create a process or thread. - Applications become unreliable when multiple programs are open simultaneously.
How to confirm this issue
Inspect the configured container limit and live cgroup task counters:
-
Check the configured container limit on the Docker host (replace
steam-headlesswith your container name):docker inspect steam-headless \--format 'network={{.HostConfig.NetworkMode}} pid_namespace={{.HostConfig.PidMode}} pids_limit={{.HostConfig.PidsLimit}}'An empty
pid_namespacevalue indicates normal private PID namespaces. Network mode does not affect PID accounting. -
Read the live task counters inside the container:
docker exec steam-headless sh -lc \'printf "current: "; cat /sys/fs/cgroup/pids.current; printf "limit: "; cat /sys/fs/cgroup/pids.max; cat /sys/fs/cgroup/pids.events'Example evidence from an exhausted container:
current: 532limit: 2048max 26The
max 26entry means task creation was refused 26 times during the lifetime of this container cgroup. An increase inmaxwhile an application launch fails confirms that a task limit blocked it. -
Check for a lower systemd service limit if only Steam or a specific service fails:
docker exec steam-headless systemctl show steam-headless-steam.service \-p TasksCurrent -p TasksMax -p EffectiveTasksMaxDisplay the complete cgroup tree if the affected application was launched from KDE Plasma, Heroic, or Flatpak:
docker exec steam-headless systemd-cgls --all --no-pager -
Check the service journal for task allocation failures:
docker exec steam-headless journalctl -b --no-pager \| grep -Ei 'resource temporarily unavailable|pthread_create|fork|clone|task'
Step-by-step resolution
Steam Headless deployment examples use a default limit of 8192. If the configured limit is lower, or if heavy multitasking exhausts the current ceiling:
-
Update your deployment configuration to set
pids_limit: 8192:- In Docker Compose:
docker-compose.ymlservices:steam-headless:pids_limit: 8192
- In
docker run, pass--pids-limit 8192. - In Unraid template Extra Parameters, add
--pids-limit 8192.
- In Docker Compose:
-
Recreate the container so Docker applies the updated cgroup limit:
docker compose up -d --force-recreate -
If the limit is already
8192andpids.eventsstill recordsmaxevents during heavy workloads, increase the limit to16384and recreate the container. -
Verify the active limit on the host and inside the container:
docker inspect steam-headless --format 'pids_limit={{.HostConfig.PidsLimit}}'docker exec steam-headless cat /sys/fs/cgroup/pids.maxBoth commands should report the newly configured limit, and the new cgroup starts with a fresh
pids.eventscounter.
4. Multi-Container Capacity and Hardware Resource Contention
When running multiple concurrent gaming sessions, containers compete for shared host resources including CPU scheduling, system RAM, GPU 3D rendering engines, and hardware video encoders. Careful planning and core pinning prevent cross-session interference and stuttering.
What you see
- Sluggish desktop navigation, video micro-stuttering, or dropped frames during gameplay.
- Audio crackles, pops, or drops out when CPU or GPU load spikes.
- Games crash during world loading or shader compilation due to GPU VRAM exhaustion.
- The Linux Out-of-Memory (OOM) killer abruptly terminates game processes or KWin.
- Video stream latency spikes due to saturated hardware encoding queues.
How to confirm this issue
Review container-scoped versus host-shared resource bottlenecks:
| Resource | Scope | Bottleneck Behaviour |
|---|---|---|
| CPU Time | Shared across all containers | High scheduling latency causes video encoding stutters and audio crackle. |
| System Memory (RAM) | Shared across all containers | Out-of-memory (OOM) killer terminates game processes or KWin. |
Memory Map Areas (max_map_count) | Shared across all containers | Games crash on launch or loading; Wine and Proton out-of-memory errors. |
| GPU 3D Engine | Shared across all containers | Lower frame rates in 3D titles; increased frame render times. |
| GPU Video Encoder | Shared across all containers | Saturated encode queues lead to dropped WebRTC packets and latency spikes. |
| GPU VRAM | Shared across all containers | Games crash with DirectX or Vulkan out-of-memory errors; textures fail to stream. |
| Inotify Instances | Shared across all containers | File watchers crash with EMFILE: Too many open files. |
Check CPU Pressure (Pressure Stall Information - PSI)
Linux Pressure Stall Information (PSI) measures the percentage of time tasks are stalled waiting for CPU cycles:
cat /proc/pressure/cpu
Example output:
some avg10=1.45 avg60=0.80 avg300=0.25 total=12489201
some avg10 < 5.00: Nominal. CPU capacity is sufficient for encoding and gameplay.some avg10between5.00and25.00: Elevated Load. Minor micro-stutters may occur in high-motion scenes.some avg10 > 25.00: Severe Starvation. Video encoders and game rendering threads are being delayed by the kernel scheduler.
Check GPU VRAM and Engine Saturation
Monitor GPU utilisation and memory allocation across running containers:
- NVIDIA GPUs:
nvidia-smi --query-gpu=utilization.gpu,utilization.encoder,memory.used,memory.total --format=csv -l 1
- Intel GPUs:
Inspect thesudo intel_gpu_top
Render/3D,Video, andVideoEnhanceengine percentage columns. - AMD GPUs:
radeontop
Step-by-step resolution
Pin CPU cores per container
To eliminate kernel scheduler thrashing across concurrent containers, pin each container to dedicated physical CPU cores using the cpuset directive in docker-compose.yml:
services:
desktop-a:
cpuset: '0-3' # Assign cores 0, 1, 2, 3 to container A
desktop-b:
cpuset: '4-7' # Assign cores 4, 5, 6, 7 to container B
Mitigate GPU VRAM and video encoder saturation
If GPU memory is nearing 95% capacity or video encoder queues saturate:
- Lower the display resolution in KDE Display Configuration. For a fresh desktop profile, choose a lower mode from the display and GPU options and add it to
docker-compose.yml:docker-compose.ymlenvironment:INITIAL_DISPLAY_WIDTH: '1280'INITIAL_DISPLAY_HEIGHT: '720'INITIAL_DISPLAY_REFRESH: '60' - Reduce texture resolution and shadow quality in individual game graphic settings.
- If video encoding queues drop frames, lower the stream bitrate or framerate in the web portal Session Controls drawer.
5. Understanding Work Capacity Indicators
The Dashboard displays a live Work Capacity card that continuously assesses your container's operating headroom across host CPU pressure, memory usage, inotify watch quotas, and task limits.
What you see
- Green (Nominal): All monitored host and container resources are operating within safe margins.
- Amber (Elevated): Host CPU pressure, memory consumption, or inotify watch counts are elevated. The container remains functional, but adding another container may cause performance degradation.
- Red (Contention): Critical resource starvation detected (such as CPU stall exceeding 25%, inotify quota exceeding 90%, or VRAM exhaustion). Video encoding latency and frame drops are expected.
How to confirm this issue
Identify the processes or subsystems causing resource pressure:
- Open the Steam Headless web portal and navigate to the Dashboard.
- Locate the Work Capacity card and click the Process Details button.
- Review the live process table sorted by CPU utilisation, memory consumption, and thread count.
- Identify runaway background processes, unresponsive game instances, or excessive thread allocations.
Step-by-step resolution
Resolve the resource constraint highlighted by the Work Capacity card:
- Inotify quota elevated or exhausted: Follow 1. Host-Wide Inotify Instance Exhaustion to raise
fs.inotify.max_user_instanceson the Docker host. - PID limit reached: Follow 3. Container Task and PID Limits to increase
pids_limitto8192or higher indocker-compose.ymland recreate the container. - Elevated CPU pressure: Follow 4. Multi-Container Capacity and Hardware Resource Contention to pin container cores via
cpusetor close background applications. - Terminating hung processes: Terminate stuck or runaway applications directly from the Process Details dialogue or restart the affected unit in the Services & Logs panel.
6. Diagnosing and Recovering Failed Systemd Units
Steam Headless uses systemd to manage its internal desktop, streaming, and audio services. If an individual background unit crashes or fails to initialise, you can inspect its logs and restart the unit without restarting or recreating the entire container.
What you see
- The container reports systemd operational state
degradedin container inspections. - A specific subsystem fails: Steam will not open, audio is silent, or Moonlight streaming drops.
- The Services & Logs interface in the web portal displays a unit highlighted in red with status
failed.
How to confirm this issue
If the web interface will not start, or its Journal page cannot load, read the journal directly inside the running container. Docker's logs are useful for early boot messages, but do not replace the service journal.
Open a container console
On the Docker host, replace steam-headless-a with your container's name and open a root shell:
docker exec --user root -it steam-headless-a bash
On Unraid, you can instead open the container's Console from the Docker tab. Run id -u to check that it reports 0 (root); otherwise use the command above in the Unraid host terminal. The following commands run inside the container, not on the host.
Check why the web interface is not starting
systemctl --failed --no-pager
systemctl status steam-headless-shui.service --no-pager --full
journalctl -b -u steam-headless-shui.service -n 200 --no-pager
status shows whether the service is running, failed, or waiting on another service. A non-zero exit status is expected for a failed service. The journal shows its startup messages and errors; -b selects the current boot, -u selects the service, and -n 200 limits the output to the latest 200 entries.
If the journal reports a dependency failure, inspect the failed dependency with the same systemctl status and journalctl -u commands. For example:
systemctl status steam-headless-compositor.service steam-headless-authd.service --no-pager --full
journalctl -b -u steam-headless-compositor.service -u steam-headless-authd.service -n 200 --no-pager
If the service has no entries, check the wider container journal for earlier startup failures:
journalctl -b -n 300 --no-pager
Follow new service messages while reproducing the problem:
journalctl -b -u steam-headless-shui.service -n 50 -f
Press Ctrl+C to stop following. Replace steam-headless-shui.service with another system service's name to investigate it. These are system services even though their processes run as the desktop user; do not add --user for them. For actual user services, run systemctl --user and journalctl --user -u <UNIT_NAME> from the desktop user's terminal instead of the root console.
Web interface fails with exit-code
steam-headless-shui.service: Failed with result 'exit-code' means the service or its preparation step exited unsuccessfully. It is a summary, not the cause. Read the service journal above and find the error immediately before the failure:
| Journal message | What to check |
|---|---|
encoder capability selection failed or no usable hardware encoder, possibly with no element "nvh264enc" | On NVIDIA, follow the host driver and container runtime checks. For other GPUs, use the hardware encoder probe checks. |
bind: address already in use, possibly after listen tcp or listen for WebRTC on UDP | Check which process already owns the listening port inside the container, as shown below. |
SHUI was not started because the authorised compositor session did not become ready | Inspect steam-headless-compositor.service with the status and journal commands above. Resolve its startup error first. |
Permission denied while creating the UI configuration, state, or TLS files under /home/steamheadless | Check the home directory ownership and storage permissions. |
For a bind error, run these commands in the root container console and find the address and port named in the error:
ss -ltnp
ss -lunp
The first lists TCP listeners and the second UDP listeners, including their owning processes. The standard web interface service listens on 8483 TCP for HTTPS and 8483 UDP for WebRTC. Check for a second manually started server or another application using that port. With host networking, host applications share these ports too. Identify and stop or reconfigure the conflicting application before restarting the affected service; do not terminate an unknown process just because it appears in the list.
A Docker error such as port is already allocated while creating the container is a host port mapping conflict. Check host listeners and other containers' published ports instead. Changing a host port mapping does not resolve a bind conflict between processes inside the same container.
Save logs for support
Before restarting or recreating the container, leave its console with exit and run this on the Docker host to save the output to a host file:
docker exec --user root steam-headless-a journalctl -b -u steam-headless-shui.service -n 300 --no-pager > shui-journal.txt
Review the file and remove passwords, tokens, private addresses, and personal information before sharing it. Include the failed service's status and the relevant dependency errors. If the container has stopped, docker exec cannot run; start with docker logs --tail 100 steam-headless-a on the host and the startup troubleshooting guide.
Step-by-step resolution
Restart the failed unit either through the web portal or via the command line:
Option A: Restart via the web portal (recommended)
- Open the Services & Logs tab in the navigation rail.
- Locate the failed unit in the System Services or User Services list.
- If that service offers a Restart button, click it and confirm the interruption.
- Watch the real-time log output stream in the lower panel to confirm clean initialisation.
Option B: Restart via the command line
Restart the unit directly from the Docker host:
docker exec -it steam-headless-a systemctl restart <UNIT_NAME>
For actual user-scope services, run this from the desktop user's terminal inside the container:
systemctl --user restart <UNIT_NAME>
Key systemd services reference
| Service Unit | Function | Recovery Action |
|---|---|---|
steam-headless-steam.service | Steam client and running games | Restart Steam after saving your game. |
steam-headless-sunshine.service | Moonlight streaming | Restart Sunshine, then reconnect Moonlight. |
pipewire.service, pipewire-pulse.service, and wireplumber.service | Desktop audio | Restart the affected audio service. |
steam-headless-plasma.service, steam-headless-shui.service, and steam-headless-shinputd.service | Desktop, UI, and input support | Read the logs, then restart the container if the service remains failed. |
Next Steps
- For step-by-step installation instructions, return to the Installation Guide.
- Keep a copy of the relevant logs so they can be attached through the official support or bug-reporting destination once it is published.