Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent: Use systemctl set-property for transient changes #34

Closed
wants to merge 2 commits into from

Conversation

fabiand
Copy link
Collaborator

@fabiand fabiand commented Jun 5, 2024

Get away fr bash based _set

Fixes #32

Get away fr bash based _set

Signed-off-by: Fabian Deutsch <[email protected]>
@fabiand
Copy link
Collaborator Author

fabiand commented Jun 6, 2024

DO NOT MERGE yet

@Barakmor1
Copy link
Member

I'm getting:

[vagrant@node01 ~]$ systemctl set-property --runtime system.slice MemorySwapMax=0 IODeviceLatencyTargetSec=$(findmnt / --output MAJ:MIN -n | sed "s/:.*/:0/") 50ms
Failed to parse IODeviceLatencyTargetSec value 252:0.

@fabiand
Copy link
Collaborator Author

fabiand commented Jul 8, 2024

Try

$ systemctl set-property --runtime system.slice \
  MemorySwapMax=0 \
  IODeviceLatencyTargetSec="$(findmnt / -no SOURCE) 50ms"

https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html

Signed-off-by: Fabian Deutsch <[email protected]>
_set 0 $FSROOT/sys/fs/cgroup/system.slice/memory.swap.max

# Set latency target to protect the root slice from io trash
MAJMIN=$(findmnt $FSROOT/ --output MAJ:MIN -n | sed "s/:.*/:0/") # fixme can be manually provided
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we change the minor to 0?

@Barakmor1
Copy link
Member

Try

$ systemctl set-property --runtime system.slice \
  MemorySwapMax=0 \
  IODeviceLatencyTargetSec="$(findmnt / -no SOURCE) 50ms"

https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html

There seems to be a parsing issue:

[core@virt-barak-416-sbbnk-worker-0-p2t86 ~]$ SOURCE=$(findmnt / -no SOURCE) && sudo systemctl set-property --runtime system.slice MemorySwapMax=0 IODeviceLatencyTargetSec=${SOURCE} 50m
Failed to parse IODeviceLatencyTargetSec value /dev/vda4[/ostree/deploy/rhcos/deploy/1c6b3c4414bec11bb664544780ba15c61ffb9bc7c2702b23ba3b87a404ea5cc9.1].

@fabiand @enp0s3
Do you think we could use the MAJMIN approach with systemctl?

@fabiand
Copy link
Collaborator Author

fabiand commented Jul 8, 2024

@Barakmor1 the bug is that we are looking at the wrong path

In the agent it is $FSROOT - speak you need to look at the root filesystem.

@fabiand fabiand closed this Jul 30, 2024
@fabiand fabiand deleted the systemd-dropins branch July 30, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use systemd drop-ins for temporary cgroup configuration
2 participants