Skip to content

Instantly share code, notes, and snippets.

@imerr
Last active September 11, 2023 13:15
Show Gist options
  • Save imerr/3fb768eda91704e6983fdea3ec58397b to your computer and use it in GitHub Desktop.
Save imerr/3fb768eda91704e6983fdea3ec58397b to your computer and use it in GitHub Desktop.
ArchiveTeam docker cpu priority
# in /etc/systemd/system/at.slice on debian
[Slice]
# optional: maximum memory usage of this slice, prevents system oom situations if a container balloons due to changes
#MemoryMax=20G
# if the cpu is 100% maxed out, at.slice processes don't get any cpu at all. They only get cpu if there is otherwise idle capacity
CPUWeight=idle
# for more options see man systemd.resource-control (or https://manpages.debian.org/bookworm/systemd/systemd.resource-control.5.en.html I guess)
# example docker run command, the important part being --cgroup-parent at.slice
docker run -d \
--cgroup-parent at.slice \
--mount type=tmpfs,tmpfs-size=2G,destination=/grab/data \
--name at-imgur \
--label=com.centurylinklabs.watchtower.stop-signal=SIGINT \
--label=com.centurylinklabs.watchtower.enable=true \
--restart=unless-stopped atdr.meo.ws/archiveteam/imgur-grab \
--concurrent 5 USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment