# Sander van Vugt - mail@sandervanvugt.nl # I don't do slides, but this is the summary of my systemd performance # talk, delivered at LCA 2017 sysadmin miniconf. # For any questions, don't hesitate to contact me at the above email address 1. CPUShares and other CGroup resources are allocated to user.slice, system.slice and machine.slice and each slice is getting an equal amount of resources. 2. A demo with two unit files shows how the CPUShare parameter behaves [root@localhost system]# cat stress1.service [Unit] Description=Discard unused blocks [Service] Type=oneshot ExecStart=/usr/bin/dd if=/dev/zero of=/dev/null CPUShares=1024 In stress2.service, everything is the same but CPUShares is set to 2048 3. To see how it works, run the two service scripts as well as a user job like dd if=/dev/zero of=/dev/null % 4. When looking at top, you might expect to see the user job getting 50% of CPU time and the two systemd jobs together getting 50% as well (where stress1 is getting half the amount of CPU shares as stress2) 5. For optimal results, run this demo on one CPU only: (temporary) switch off some CPUs via /sys/devices/system/cpu 6. For more detailed information, use systemd-cgtop and systemd-cgls 7. Use systemctl show on the stress scripts to see available CGroups parameters in systemd 8. The authoritative documentation is in systemd.resource-control