/go/slice limits how much CPU and memory a single user can use through login sessions on the server, such as SSH sessions. It reads two numbers from GoAdmio's configuration, CPULimit and MemoryLimit, and writes them as a systemd configuration for user-.slice. Use it to stop one user from using up the whole server. The command takes no arguments. Change the limits in GoAdmio, then run /go/slice to apply them. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Apply the saved limits
/go/slice
Examples
# Apply the saved limits
/go/slice
# See the file that was written
cat /etc/systemd/system/user-.slice.d/all.conf
# Check the limits for one user (replace 1000 with the user's numeric ID)
systemctl show user-1000.slice -p CPUQuotaPerSecUSec -p MemoryHigh -p MemoryMax
# Review recent calls
tail /var/log/go/slice.log
Output
When the limits are valid, the command prints nothing. Check the result with the commands under Examples.
When a limit is empty or not a number, it prints:
Error: Invalid CPU or Memory limit values
and ends with exit status 1. Nothing is changed.
See the full reference at /go/slice and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
