Announcement

Collapse
No announcement yet.

Kubuntu 26.04 LTS - important things to do after an installation

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by JoshiFresa View Post
    In my case I have 32 Gb of Ram to avoid swapping as much as possible. You're saying that you've gone to zero swapping if I understand correctly. I think that's what I'm looking for myself. What is the correct command to operate it if you think that it can work in my conditions?
    No. Swappiness is a strange thing. Even with large amounts of ram, some systems still want to access swap at times, even just a tiny bit. The swappiness setting is just how much this might be delayed. The tendency to hit swap sooner *seems* to have improved in my usage, from that 8gb laptop (which seldom ever seems to access swap) and even 32Gb systems do.

    Basically, if you are not experiencing issues, don't mess with it. I, personally, have not had to mess with it myself, despite the same hardware needing it in the recent past.


    if you want zero swapping, then don't have a swap.
    Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
    HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
    HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

    Comment


      #17
      Originally posted by claydoh View Post
      No. Swappiness is a strange thing. Even with large amounts of ram, some systems still want to access swap at times, even just a tiny bit. The swappiness setting is just how much this might be delayed. The tendency to hit swap sooner *seems* to have improved in my usage, from that 8gb laptop (which seldom ever seems to access swap) and even 32Gb systems do.
      Basically, if you are not experiencing issues, don't mess with it. I, personally, have not had to mess with it myself, despite the same hardware needing it in the recent past.
      if you want zero swapping, then don't have a swap.
      Thanks, much appreciated clarification.

      Comment


        #18
        Claydoh hi, look at this page: https://askubuntu.com/questions/1039...ure-swappiness

        In his description it says:

        Which swappiness should I use?


        I highly recommend vm.swappiness=0! It makes my machine run soooo much better. From my anecdote in my answer here:
        I have found that setting swappiness to 0 significantly improves the performance of my system which has 32 GB RAM, a 64 GB swap file on a high-speed m.2 SSD, and which is continually running out of RAM.

        With swappiness set to the default of 60, I'd regularly get 1 to 2 minute lockup periods while kswapd0 is running (as shown by top) to try to swap memory for some memory hog application like Chrome, Slack, Eclipse, or Google Meet (within Chrome). I'd start to get these lockups at 80% full RAM. The computer would be completely unusable during this time--unable even for me to type into a terminal or click on a menu.

        Setting swappiness to 0 significantly helped!. I started not getting really high CPU usage until 90% RAM full, swap space would still get used plenty--but more efficiently, and when my RAM did get almost full my computer would become very sluggish, but still barely usable rather than completely unusable!

        See some of my symptoms here, which I originally thought were due to a bug in Google Meet, but now think were due to memory swap making my computer slow: https://github.com/ElectricRCAircraf...sue-1177137900



        Is it random or serious allegation?
        And if I would choose to try swappiness=0 what is the best command to make it permanent, not just for the current session?
        Last edited by JoshiFresa; Apr 30, 2026, 09:10 PM.

        Comment


          #19
          I have never seen setting it to 0 disable it. That does not mean the top response on the page is wrong.

          But if you want to test, then make permanent, just follow the howto from Schwarzer Kater and test changes for a number of days.


          Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
          HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
          HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

          Comment


            #20
            Originally posted by claydoh View Post
            I have never seen setting it to 0 disable it. That does not mean the top response on the page is wrong.
            But if you want to test, then make permanent, just follow the howto from Schwarzer Kater and test changes for a number of days.
            I opened the 99-sysswappiness.conf to understand what the command of schwarzer kater does. So if I want to try zero-swappiness I guess I just have to transpose to this (?) :

            Code:
            echo -e "# Reduce swappiness for desktop installation (default = 60)\nvm.swappiness=0" | sudo tee /etc/sysctl.d/99-sysswappiness.conf
            Then using Reboot.

            I've become more careful thanks to you guys so I prefer to ask again to make sure I get it right.

            Comment


              #21
              JoshiFresa : yes, this would be the correct command to set swappiness=0.


              Concerning step 2.:

              I have tried to make the short explanation a bit more technically precise.
              Please read e.g. the Arch Wiki for further explanations.

              I have come across swappiness values between 0 and 35 for desktop systems, but as "10" is Ubuntu's suggestion for desktop systems (and Ubuntu is the "mother" of Kubuntu - and 10 is a very common value) I will stick to it in this guide.
              But feel free to experiment by yourselves.


              -> I think if somebody would like to discuss swappiness any further, it would be better to open a separate thread for this…
              Last edited by Schwarzer Kater; May 01, 2026, 03:24 AM. Reason: addition
              Debian LXQt • Kubuntu • openSUSE KDE • Linux Mint • Windows • macOS
              Desktop: HP Elite SFF 805 G9 • Laptop: Apple MacBook Pro 13" • and others

              important things to do after installation (24/26.04)get rid of Snap script (20.04 +)
              install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04 +)

              Comment


                #22
                Originally posted by Schwarzer Kater View Post
                as "10" is Ubuntu's suggestion for desktop systems
                To be clear, this is a community-created and edited section (when it isn't down ), and not necessarily official with a capital "O." I have edited some things in the wikis in the past, if you dig back far enough. But this page has been in the wiki as long as I can recall. That does lend it some sort of veracity. But it is old and not kept up-to-date enough. I am leaning toward that 10 value being more for HDDs than anything else, but probably good for desktops still in any case, if there are issues seen. And swap as a topic is a more complicated thing; it isn't just "emergency ram " at all. Yes, I went down the rabbit hole on this one.

                I know I am digging into the weeds here, but we do suffer in Linux Land from some ideas and thoughts that become the accepted answer but with little or no actual proof or reasoning to explain it. Or have actually changed over time. That wiki page on swap still incorrectly states that you can't have a swap file on btrfs, and I have used one for some time now, as provided by Calamares in Kubuntu, even.
                Last edited by claydoh; May 01, 2026, 05:05 AM.
                Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
                HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
                HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

                Comment


                  #23
                  Originally posted by JoshiFresa View Post
                  Claydoh hi, look at this page: https://askubuntu.com/questions/1039...ure-swappiness

                  In his description it says:



                  Is it random or serious allegation?
                  And if I would choose to try swappiness=0 what is the best command to make it permanent, not just for the current session?
                  Using swappiness=0 does not disable swap.

                  It does not work in the way like you think it does. Do not be offended, but if you want to understand a little more about swap and swappiness, i suggest you to read more technical papers about it. It is not so simple to understand.

                  Anyway, look what Linus Torvalds says about it:

                  https://git.kernel.org/pub/scm/linux...st?h=v6.1#n892

                  " swappiness ==========

                  This control is used to define the rough relative IO cost of swapping and filesystem paging, as a value between 0 and 200.
                  At 100, the VM assumes equal IO cost and will thus apply memory pressure to the page cache and swap-backed pages equally; lower values signify more expensive swap IO, higher values indicates cheaper.
                  Keep in mind that filesystem IO patterns under memory pressure tend to be more efficient than swap's random IO.
                  An optimal value will require experimentation and will also be workload-dependent.
                  The default value is 60. For in-memory swap, like zram or zswap, as well as hybrid setups that have swap on faster devices than the filesystem, values beyond 100 can be considered.
                  For example, if the random IO against the swap device is on average 2x faster than IO from the filesystem, swappiness should be 133 (x + 2x = 200, 2x = 133.33).

                  At 0, the kernel will not initiate swap until the amount of free and file-backed pages is less than the high watermark in a zone.​ "

                  So, as you can see, swappiness=0 does not mean it will disable swap. It is very important to understand fylesystem paging, file-backed pages and page cache in memory use to understand in a better way the swappiness process. There are a much others process involved on it.

                  Then, if you are on a desktop usage leave it on 10 . It works good for most of the people.

                  Comment


                    #24
                    Originally posted by Virginio Miranda View Post
                    Using swappiness=0 does not disable swap.
                    It does not work in the way like you think it does. Do not be offended, but if you want to understand a little more about swap and swappiness, i suggest you to read more technical papers about it. It is not so simple to understand.
                    Anyway, look what Linus Torvalds says about it:
                    https://git.kernel.org/pub/scm/linux...st?h=v6.1#n892

                    " swappiness ==========

                    This control is used to define the rough relative IO cost of swapping and filesystem paging, as a value between 0 and 200.
                    At 100, the VM assumes equal IO cost and will thus apply memory pressure to the page cache and swap-backed pages equally; lower values signify more expensive swap IO, higher values indicates cheaper.
                    Keep in mind that filesystem IO patterns under memory pressure tend to be more efficient than swap's random IO.
                    An optimal value will require experimentation and will also be workload-dependent.
                    The default value is 60. For in-memory swap, like zram or zswap, as well as hybrid setups that have swap on faster devices than the filesystem, values beyond 100 can be considered.
                    For example, if the random IO against the swap device is on average 2x faster than IO from the filesystem, swappiness should be 133 (x + 2x = 200, 2x = 133.33).
                    At 0, the kernel will not initiate swap until the amount of free and file-backed pages is less than the high watermark in a zone.​ "
                    So, as you can see, swappiness=0 does not mean it will disable swap. It is very important to understand fylesystem paging, file-backed pages and page cache in memory use to understand in a better way the swappiness process. There are a much others process involved on it.
                    Then, if you are on a desktop usage leave it on 10 . It works good for most of the people.
                    Thanks Virginio for the additional knowledge. No worries, I had some awareness that swappiness is based on some kind of allocation priority that does not eliminate swapping but its priority or aggressiveness. I'm just being nosy because I love to hear about other's experience. My motivation is that I've been wondering if reducing the size of the swap file, also found in Windows, was an idea but Claydoh advised to not mess much with swapping, so I just keep suscitating debate to see what I can learn about it. My main noob's concern is of course about the life of my SSD (maybe just influenced by pure hype without real foundation?), that is already 2-3 years old, and I've been using it intensely with windows installed in the past without even being aware of the effect of swapping on this device. The role of browsers too, always having multiple browsers open with plenty of windows, using intense graphics all the time and AI, constant read/write. The jungle of information is huge so it's good to read real tech people's opinion. So while I'm learning I'm clearly missing a huge amount of information and implications but I'm actually blessed to have you guys answering most of my questions here, which isn't a small thing! I'll comment after reading my Finnish compatriot Linus..
                    Last edited by JoshiFresa; May 01, 2026, 07:08 PM.

                    Comment


                      #25
                      Yes reading this text it's confusing what's the relation between "page cache" and "swapped-backed pages" as both seem to be related to write/read to the SSD/HD. What I understand from it is that while the "page cache" is stored on disk, it can be accessed directly by RAM, which is great, but then the "Swap File" comes in when the RAM is filled up! Many players here to insure that the roulette game goes on. Only that page cache or file cache are SLOW because even an SSD is much slower than RAM. Since I have 32 Gb of RAM this is less likely to happen unless I have many apps open (which is often my case). The text refers to zram or zswap, which, if I understand it correctly is a space created directly into RAM to be released like a gunshot of data for the apps when needed. Is zram or zswap a good solution for me since I have a good amount of RAM? And in terms of swappiness would it mean to just raise the number between 100 to 200? And is there something particular to do to "install" zwap/zram into function, or is it just a question of the amount of swappiness? This seems contradictory if more swappiness (up to 100 or more?) means more writing to disk, so how would a number over 100 use more RAM? That's my confusion so far. All this opens my mind to the complexity of guarantying a constant flow of information to the working apps for the user.
                      Last edited by JoshiFresa; May 01, 2026, 07:13 PM.

                      Comment


                        #26
                        JoshiFresa ,

                        Take a look at:

                        https://medium.com/@amanpatel.workid...t-51178d52913b

                        It will be a good start to understand a page cache and swapped-backed pages.

                        Attached Files

                        Comment


                          #27
                          Originally posted by Virginio Miranda View Post
                          JoshiFresa ,
                          Take a look at:
                          https://medium.com/@amanpatel.workid...t-51178d52913b
                          It will be a good start to understand a page cache and swapped-backed pages.
                          Thanks, I enjoyed reading it and back to the Linus text again. Before that I had it wrong in a few things, like I thought that the swapping happened between the apps and the swap file, but it's more about the Ram purging itself for more action.

                          The Zswap function is not enabled in Kubuntu by default. It seems to make sense although Linux already seems to make a good used of "not used Ram". Many people report that Zswap is really useful even if it uses CPU to decompress but still much faster than disk swapping. What do you think about it? That's the last thing I will ask to not fill this post with my concerns.

                          Comment

                          Users Viewing This Topic

                          Collapse

                          There are 0 users viewing this topic.

                          Working...
                          X