Autopause
Lumo Server includes an intelligent autopause system that automatically pauses the JVM when no players are online, saving CPU and power while keeping memory allocated for instant wake-up.
How Autopause Works
Section titled “How Autopause Works”The autopause system uses a multi-component architecture:
- autopause.sh: Monitors player activity and chunk loading
- wake-listener.py: Intercepts connection attempts while paused
- socat proxy: Routes traffic through the wake listener when paused
Architecture
Section titled “Architecture”Active State (Players Online)
Section titled “Active State (Players Online)”External:25565 → socat proxy → localhost:25566 (Minecraft server)Paused State (No Players)
Section titled “Paused State (No Players)”External:25565 → wake-listener.py (shows "sleeping" message, triggers wake)The Minecraft server process is paused with SIGSTOP - it’s frozen in memory but uses no CPU.
Configuration
Section titled “Configuration”| Variable | Default | Description |
|---|---|---|
ENABLE_AUTOPAUSE | true | Enable/disable autopause functionality |
AUTOPAUSE_TIMEOUT | 10 | Minutes of idle time before pausing |
AUTOPAUSE_POLL_INTERVAL | 30 | Seconds between activity checks |
Enable Autopause
Section titled “Enable Autopause”docker run \ -e ENABLE_AUTOPAUSE=true \ -e AUTOPAUSE_TIMEOUT=15 \ ghcr.io/lucasilverentand/lumo-server:latestDisable Autopause
Section titled “Disable Autopause”docker run \ -e ENABLE_AUTOPAUSE=false \ ghcr.io/lucasilverentand/lumo-server:latestWhen to disable:
- Running in Kubernetes (conflicts with liveness probes)
- Need guaranteed 24/7 uptime
- Running scheduled tasks or plugins that need continuous execution
What Counts as “Activity”
Section titled “What Counts as “Activity””The autopause system monitors:
- Player count: Any players logged in
- Chunk loading: Chunks being loaded (indicates plugin activity, hoppers, farms)
If either indicates activity, the server stays active.
Pause/Wake Process
Section titled “Pause/Wake Process”Going to Sleep
Section titled “Going to Sleep”- No players online for
AUTOPAUSE_TIMEOUTminutes - No chunk loading activity detected
- autopause.sh sends
SIGSTOPto Minecraft process - JVM freezes (no CPU usage, memory retained)
- socat proxy redirects port 25565 to wake-listener.py
Waking Up
Section titled “Waking Up”- Player attempts to connect
- wake-listener.py receives connection
- Shows “Server is sleeping, waking up…” message
- Sends
SIGCONTto Minecraft process - Server resumes within 1-2 seconds
- Player connects normally (may need to retry connection)
Player Experience
Section titled “Player Experience”Connecting to Sleeping Server
Section titled “Connecting to Sleeping Server”When a player connects to a paused server:
- Connection attempt shows: “Server is sleeping, waking up…”
- Connection times out (server waking)
- Player retries connection
- Server is now active, connection succeeds
Tip for players: If you see “Server is sleeping”, wait 5 seconds and reconnect.
Resource Savings
Section titled “Resource Savings”Active Server
Section titled “Active Server”- CPU: 50-200% (2-4 cores)
- Memory: 4GB (as configured)
- Power: ~100-200W
Paused Server
Section titled “Paused Server”- CPU: 0% (fully paused)
- Memory: 4GB (retained for instant wake)
- Power: ~5-10W (baseline only)
Savings: ~95% CPU, ~95% power, instant wake-up
Port Proxy Details
Section titled “Port Proxy Details”The entrypoint.sh sets up port proxying:
# Active state: Route to Minecraft serversocat TCP-LISTEN:25565,fork,reuseaddr TCP:localhost:25566
# Paused state: Route to wake listener# (autopause.sh switches this automatically)Minecraft server runs on port 25566 internally, proxy exposes it on 25565.
Monitoring Autopause
Section titled “Monitoring Autopause”Check if Server is Paused
Section titled “Check if Server is Paused”# Check process statedocker exec minecraft-server ps aux | grep javaLook for T in the state column (means stopped/paused).
View Autopause Logs
Section titled “View Autopause Logs”docker logs minecraft-server | grep -i autopauseSample logs:
[AUTOPAUSE] No activity detected, pausing server...[AUTOPAUSE] Server paused (PID 123)[WAKE] Connection received, waking server...[AUTOPAUSE] Server resumedTest Autopause
Section titled “Test Autopause”-
Start server with short timeout:
Terminal window docker run -e AUTOPAUSE_TIMEOUT=1 -e ENABLE_AUTOPAUSE=true ... -
Wait 1 minute with no players
-
Check if paused:
Terminal window docker exec minecraft-server ps aux | grep java -
Try to connect - you should see “Server is sleeping” message
Compatibility
Section titled “Compatibility”Works With
Section titled “Works With”- Docker / Docker Compose
- Single-container deployments
- Autopause-aware clients (auto-retry connection)
Conflicts With
Section titled “Conflicts With”- Kubernetes liveness/readiness probes: Probes fail while paused, pod gets killed
- Always-on monitoring: Services that expect 24/7 response
- Scheduled plugins: Plugins with cron jobs won’t run while paused
Kubernetes Users
Section titled “Kubernetes Users”Autopause is disabled in Kubernetes deployments due to health check conflicts.
If you want autopause in K8s:
-
Set
ENABLE_AUTOPAUSE=true -
Remove or adjust liveness probes:
livenessProbe:tcpSocket:port: 25565initialDelaySeconds: 300periodSeconds: 60 # Increase intervalfailureThreshold: 10 # More tolerance -
Expect potential pod restarts during pause
Troubleshooting
Section titled “Troubleshooting”Server Won’t Pause
Section titled “Server Won’t Pause”Check logs:
docker logs minecraft-server | grep -i autopauseCommon causes:
- Plugin activity (chunk loaders, farms)
- Player still logged in
AUTOPAUSE_TIMEOUTtoo long- Autopause disabled
Server Won’t Wake
Section titled “Server Won’t Wake”Symptoms: Connection hangs, no “sleeping” message
Fixes:
# Manually wake serverdocker exec minecraft-server pkill -CONT java
# Check wake-listener is runningdocker exec minecraft-server ps aux | grep wake-listener
# Restart container if brokendocker restart minecraft-serverPort Issues
Section titled “Port Issues”Error: “Address already in use”
Fix:
# Check what's using port 25565docker exec minecraft-server netstat -tulpn | grep 25565
# Restart server to reset port proxydocker restart minecraft-serverPlayer Can’t Connect After Wake
Section titled “Player Can’t Connect After Wake”Symptom: Server wakes but connection fails
Fix:
- Player should retry connection after 5-10 seconds
- Check logs for errors:
docker logs minecraft-server - Verify server is actually running:
docker exec minecraft-server ps aux | grep java
Advanced Configuration
Section titled “Advanced Configuration”Custom Wake Message
Section titled “Custom Wake Message”The wake message is in /wake-listener.py. To customize:
# Copy script outdocker cp minecraft-server:/wake-listener.py ./wake-listener.py
# Edit the messagenano wake-listener.py # Edit the response string
# Copy backdocker cp ./wake-listener.py minecraft-server:/wake-listener.py
# Restartdocker restart minecraft-serverAdjust Activity Detection
Section titled “Adjust Activity Detection”The autopause.sh script monitors chunks. To adjust sensitivity, you’d need to modify the script:
# View current scriptdocker exec minecraft-server cat /autopause.sh
# Would require custom image to modifyBest Practices
Section titled “Best Practices”- Set reasonable timeout: 10-15 minutes prevents frequent pause/wake cycles
- Inform players: Let them know the server auto-pauses and to retry connection
- Monitor logs: Check autopause logs regularly for issues
- Test wake: Periodically test that wake works correctly
- Disable for critical periods: Disable during events or scheduled tasks
Next Steps
Section titled “Next Steps”- Environment Variables - Full autopause configuration
- Architecture - Deep dive into autopause implementation
- Troubleshooting - Common issues