You can do this with cgroups but you aren't allowed to use cgroups if you use systemd, because it messes up systemd.

systemd is the primary user of cgroups. Your comment doesn't make sense.