Welcome to the Linux Foundation Forum!

LAB 2.6 foo.slice doesn't have any impact

Somehow CPU usage stays 100%.
I also tried to make a [Slice] in foo.service.
I did the stop / reload-deamon /start.
I tried reboot once.
I tried to make /usr/lib/systemd/system/foo.slice
Operating System is Manjaro.

  1. /etc/systemd/system >>> cat foo.service foo.slice
  2.  
  3. [Unit]
  4. Description=Example service unit to run stress]
  5. Slice=foo.slice
  6. [Service]
  7. ExecStart=/usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  8. [Install]
  9. WantedBy=multi-user.target
  10.  
  11.  
  12. [Unit]
  13. Description="stress slice"
  14. [Slice]
  15. CPUQuota=30%

It just stays under the system.slice

  1. /etc/systemd/system >>> sudo systemctl status -l foo.service [1]
  2. foo.service - Example service unit to run stress]
  3. Loaded: loaded (/etc/systemd/system/foo.service; disabled; vendor preset: disabled)
  4. Active: active (running) since Fri 2021-02-26 17:12:40 CET; 57s ago
  5. Main PID: 22562 (stress)
  6. Tasks: 9 (limit: 4555)
  7. Memory: 697.5M
  8. CGroup: /system.slice/foo.service
  9. ├─22562 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  10. ├─22563 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  11. ├─22564 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  12. ├─22565 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  13. ├─22566 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  14. ├─22567 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  15. ├─22568 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  16. ├─22569 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  17. └─22570 /usr/bin/stress --cpu 2 --io 2 --vm 4 --vm-bytes 256M
  18.  
  19. Feb 26 17:12:40 blabla systemd[1]: Started Example service unit to run stress].
  20. Feb 26 17:12:40 blabla stress[22562]: stress: info: [22562] dispatching hogs: 2 cpu, 2 io, 4 vm, 0 hdd

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 380

    Thank you for bringing this to our attention, investigating.
    Lee

  • Posts: 3

    Hi Lee

    I just tied to add the connection of the .slice under [Service] as in the Arch Wiki but it's not working either.
    https://wiki.archlinux.org/index.php/Cgroups#Grouping_unit_under_a_slice

    I also checked the solutions of the lab exercise but the Slice=foo.slice entry is missing completely. (Solutions are attached to the post)

    1. /usr/.../systemd/system >>> cat foo.service foo.slice
    2.  
    3. [Unit]
    4. Description=Example service unit to run stress
    5. [Service]
    6. Slice=foo.slice
    7. ExecStart=/usr/bin/stress --cpu 4 --io 4 --vm 2 --vm-bytes 256M
    8. [Install]
    9. WantedBy=multi-user.target
    10.  
    11. [Unit]
    12. Description="stress slice"
    13. [Slice]
    14. CPUQuota=30%
  • Posts: 380

    Is the script track-STRESS.sh showing system.slice or foo.slice in the output?
    There may have been a default config option change causing cgroupsV2 to be activated.

    Thanks Lee

  • Posts: 3

    system.slice as in the systemctl status -l foo under CGroup: CGroup: /system.slice/foo.service

  • Posts: 380

    That may be the clue I was looking for, it should be foo.slice. I'll check it out and get back to you.

    Lee

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training