Results 1 to 6 of 6

Thread: Individual processes in cgroup for distinct swappiness

  1. #1

    Default Individual processes in cgroup for distinct swappiness

    Hi,


    I have been using Leap 15 (and now 15.1) since the beginning and I see that it already comes with a pre-configured cgroup tree with system.slice, user.slice, etc

    I would like to change the swappiness of a specific process (probably by his PID) without having to re-mount cgroups from scratch. That is, keeping the default cgroup tree that is shipped with Leap 15.1 (except maybe for creating a new subfolder into /sys/fs/cgroup/memory ).

    One option I saw may help is through

    Code:
     systemctl set-property --runtime ...
    But I haven't found any command to set the swappiness, just the maximum size of the swap file.


    Thank you all in advance.

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,460
    Blog Entries
    2

    Default Re: Individual processes in cgroup for distinct swappiness

    IMO...
    Traditional documentation describes how you can manage swappiness of processes running in a cgroup, here is one serverfault discussion that includes an example how to set the swappiness of the chosen cgroup
    https://serverfault.com/questions/52...-and-from-swap

    Nowadays though...
    I'd take advantage of the fact that Linux containers are built on cgroups,
    and I'd suggest running your process, application or multiple anything in a Docker container...
    You can run just about anything or a collection of somethings in a Docker container, even a single process
    And then you can configure resource usage including swappiness for that container
    The following documentation provides the bare bones info...
    https://docs.docker.com/config/conta...e_constraints/

    Curiously, I looked for similar documentation for LXC but couldn't find any... I don't know if you can tune memory for LXC like you can in Docker, at least easily.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,460
    Blog Entries
    2

    Default Re: Individual processes in cgroup for distinct swappiness

    BTW -
    If you're interested in doing what you're asking about in Docker but haven't any experience with that before,
    The Docker tutorials I wrote modifying official documentation at the time can get you set up and running a single process in a container in no time...

    https://en.opensuse.org/User:Tsu2/Docker_Install

    Although there is a lot more to Docker today, the above tutorials still cover the most basic things to know and very nearly might be all you need for your use.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4

    Default Re: Individual processes in cgroup for distinct swappiness

    Thank you

    Any chance it could also work for the processes plasmashell, X, and kwin_x11 ?

    I have been tracking down the swap memory usage of these processes under my heavy work load and they always keep swapping. It is hindering my work flow, so that I often find myself having to change back (and even this transition is slowed) to console login in order to manage the system from command line.
    To test that it is this respective swapping that is hindering the Desktop Environment's GUI responsiveness under my work load with heavy swap usage, I specifically killed these 3 processes and restarted them so that they initially were not swapped after this restart. Then, the general GUI responsiveness of the DE come back to normal (for a decent period of time until the kernel start to swap them again).

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,460
    Blog Entries
    2

    Default Re: Individual processes in cgroup for distinct swappiness

    I don't know if it's a good idea to over-ride how individual system services behave automatically...
    I don't know your reasons to be running a "heavy" DE like KDE/Plasma
    If you're willing to consider a "lighter" alternative,
    LXQt today is built on the exact same Qt framework as KDE/Plasma but without the heavy overhead, widgets, and misc.
    And, if you want to go "ultra-light" you might simply boot into IceWM to run only a bare bones but very functional X11 environment... In fact, I've found that running IceWM in my VMs uses no more RAM and hardly any more resources than a text mode only system.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,460
    Blog Entries
    2

    Default Re: Individual processes in cgroup for distinct swappiness

    One last available tool for addressing this type of situation where system buffers and cache have been stuffed full and you want to clear them (essentially reversing the stored locations back into active memory where it can be more volatile)

    https://en.opensuse.org/User:Tsu2/free_tool

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •