How do I diagnose what causes my OS to "deteriorate" over time?

Status
Not open for further replies.
@username wrote:
What I do mind, however, is false advertising! I see a button for sleeping, I click that button, and I expect PC to peacefully go to sleep, and - pay attention, this is a crucial part - I expect it to work after waking up. Amazing, right?
Alas ... if the world were only so beautifully constructed :). Linux is still improving in this area of sleep and hibernation, and as mentioned in this article, it improves with each kernel: https://www.cyberciti.biz/faq/linux-command-to-suspend-hibernate-laptop-netbook-pc/. That suggests that the most recent kernel that you can install is probably the best way to go in the first instance dealing with this issue.

The article also provides a set of commands which give relatively fine control over sleep (hibernation) and suspend and how to dig down deeper into what's actually happening. Again, it's a learning curve.
 


Your RAM

Memory:
RAM: total: 30.76 GiB used: 16.79 GiB (54.6%)

Your Swap

Swap:
Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
ID-1: swap-1 type: partition size: 1.91 GiB used: 1.91 GiB (100.0%)
priority: -2 dev: /dev/dm-2 maj-min: 253:2 mapped: vgkubuntu-swap_1

My RAM

Memory:
RAM: total: 15.53 GiB used: 3.45 GiB (22.2%)

My Swap

Swap:
Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
ID-1: swap-1 type: file size: 947.3 MiB used: 0 KiB (0.0%) priority: -2
file: /swapfile

You'll note with mine:
  1. about 1 GB of Swap, but I did not create it, Kubuntu (and a number of other distros do the same) creates it by default at installation. The "file: /swapfile" is a reference to the line in my /etc/fstab
    Code:
    /swapfile       none    swap    sw      0       0
  2. of that 947.3 MiB allocated by Kubuntu, zero is being used.

And you'll note with yours:
  1. about 2 GB of Swap, either created by Kubuntu in reference to your having twice the RAM as me, or else manually created by you (you could tell us which)
  2. of that 1.91 GiB, 100% is being used
,,, and yet you have 32 GB of RAM - that should not happen and yet it is.

I'll talk a little more about Swap after I grab a beer (I only drink beer on days ending with 'y'), and I will eliminate my reference to swap in my /etc/fstab and we can compare any differences.
 
After that amendment to /etc/fstab and a reboot

My RAM

Code:
Memory:
  RAM: total: 15.53 GiB used: 3.25 GiB (20.9%)

and my Swap, not surprisingly

Code:
Swap:
  Alert: No swap data was found.

I have the same Firefox open, at the same tab, and Terminal open with the inxi command, all same as before.

My used RAM expended has actually dropped from

3.45 GiB (22.2%)

to

3.25 GiB (20.9%)

IME and IMO

In my experience, since I had 40 Linux running on a Toshiba Satellite laptop with 8 GB RAM some years ago, to now - I find swap unnecessary. The old advice, of having a Swap partition the size of your RAM, or even double the size, was from an era when we had maybe 4 GB RAM on a good day, and perhaps as low as 2GB.

To have a Swap twice the size of your RAM that is 64 GB, would be ludicrous. Just a waste of space.

There is a divided school on whether on SSDs, swap has an adverse effect which reduces the lifespan of the drive, but I do not know of anything conclusive.

Swap also gets a workout if you subscribe to hibernating, in fact you cannot hibernate under Linux unless you have swap enabled.

I don't hibernate, so no issue.

In my opinion, you could try one or both of two things if you want to experiment and get more information.

1. Use your search engine for

linux what is swappiness

and perhaps change your swappiness from 60 to 10

2. Try removing the swap, or at least disable it, and see how it affects performance.

Cheers

Wizard
 
This is one of the reasons why I like Puppy.

32 GB RAM here. I do have a swap partition of around 48 GB, but I suspend quite frequently. Still, with having around 6 TB storage all told, that's not even 1% of the total, so.....ah, what the hell. This is on the secondary 'data drive', NOT the primary SSD.

(Before anyone says it, I know it's only hibernation that supposedly wants swap. Truth to tell, I'm not entirely certain WHAT this HP desktop does - suspend OR hibernate; it could even be some weird 'hybrid' of the two for all I'm aware. What I DO know is that whenever I pause things overnight, it insists on mirroring the entire contents of RAM to a single, contiguous location, regardless of how much - or how little - is actually in use. If the swap area is not big enough - I have a couple of smaller swap areas in various locations, as well - such that what's in RAM would have to be split into smaller chunks, it never, ever 'recovers' correctly.

Maybe it IS hibernation. I don't really care; it does what I want, and that's good enough for me. Yet it's definitely
called by a suspend script, so.....)

Sheesh. I've long since given up worrying about it. It works.....and that's the main thing.

------------------------------

I've had swappiness dialled down to "10" for a long time.

-----------------------------

As Puppies have evolved over time, they've gradually become larger, too. That's inevitable, given that apps, dependencies, etc, have all had extra functionality added over the years, and additional background service, daemons, log services, etc, have also been added.

Even so, running even the current Puppies, plus one of the Chromium-based browsers with half-a-dozen tabs open (remember these have individually sandboxed tabs, so use more RAM for that).......on a day-to-day basis, this normally shows around 30.1 GB RAM as still being free, out of a total available of 31.9. Around 1.8 GB in total.....and NO swap used. Which effectively means there's still 30 GB for me to use as I see fit.

(That 1.8 GB includes the whole of Puppy, 'cos it all loads into and runs from RAM. Not just whatever the OS "pulls" off the hard drive as & when It needs it...)

------------------------------

More than half of the OP's RAM.....and ALL of their swap in use? Something's definitely not right there.


Mike. :confused:
 
Last edited:
A few thoughts. The "massive slowdown" is not normal linux functioning, so there is a problem. Some linux systems run for days, months and even years without reboot and without this problem.

If you suspect it is KDE as you mention, then that is quite straight forward to test. You can install a lighter desktop environment, or just a window manager and carry out the very activities that you do on your machine and see if it exhibits the same behaviour or not. One means of doing this is run just a window manager like openbox, fluxbox, icewm or any of a dozen others since they can all allow you to run whatever you like. There's a learning curve for each one, but in my view it's worth the trouble for helping on this issue. It means that you would need to not run KDE which is easily done by booting to a text prompt and starting X and the window manager from there by-passing the normal KDE GUI start up.

Another thought is to inspect the logs and record over time what is happening. Firstly I guess I'd run something like:
Code:
journalctl -b -x -p 3
where -b means "this boot" -x means "explanation of errors" and -p means the priority of message where 3 means "error". This same command can be run for any of the previous boots by adjusting the -b option, where 1 is the first boot in the journal, 2 the second etc, but the boot before the current one is -1, and the boot before that is -2. See the manpage for details but working back from the current boot makes sense since the journal may have numerous boot records still depending on how it's been configured.

Another check is to see if any firmware or microcode is missing:
Code:
dmesg | grep -i microcode
dmesg | grep -i firmware
and if any is missing, install it. Absence of these things can increase the loads on various parts of the machine like the CPU and the GPU.

Thanks! I ran all of them, it turned out that something was indeed wrong with the GPU, I tried to fix it by installing amdgpu, it almost bricked my device (got stuck on "running system checks", ctrl-c didn't help), restored the backup and I'm at square one....

The good news is that the firmware seems to be up to date. The bad news is that although journalctl -b -x -p 3 showed several errors, 90% of them were some Bluetooth-related nonsense, the rest GPU-related, but none with KDE or anything that could point me in the direction of finding out what is going on with my OS.
---
Based on output from journal:
Code:
[drm:parse_hdmi_amd_vsdb [amdgpu]] *ERROR* EDID CEA parser failed
[drm:dc_dmub_srv_wait_idle [amdgpu]] *ERROR* Error waiting for DMUB idle: status=3
https://forum.manjaro.org/t/amd-gpu-wake-from-sleep-intermittent-issue-unresponsive-related-to-vblank/122014/1
amdgpu 0000:03:00.0: amdgpu: Ack AC/DC interrupt Failed!
gkr-pam: unable to locate daemon control file
org.freedesktop.DBus.Properties.Get /org/bluez/hci0/dev_00_1B_66_C6_50_56/sep5/fd1 Volume failed: org.free>
Error opening PCM device front:2: No such file or directory

I found a similar problem here:


TLDR: Guy says it can be solved by either:
  • add the kernel parameter drm.vblankoffdelay=0
  • apply a fix to the GPU driver

Both of these solutions seem a bit risky to me, so I thought it would be better to consult this problem with you guys before I brick my device for good. What do you guys think about this?
 
Your RAM



Your Swap



My RAM



My Swap



You'll note with mine:
  1. about 1 GB of Swap, but I did not create it, Kubuntu (and a number of other distros do the same) creates it by default at installation. The "file: /swapfile" is a reference to the line in my /etc/fstab
    Code:
    /swapfile       none    swap    sw      0       0
  2. of that 947.3 MiB allocated by Kubuntu, zero is being used.

And you'll note with yours:
  1. about 2 GB of Swap, either created by Kubuntu in reference to your having twice the RAM as me, or else manually created by you (you could tell us which)
  2. of that 1.91 GiB, 100% is being used
,,, and yet you have 32 GB of RAM - that should not happen and yet it is.

I'll talk a little more about Swap after I grab a beer (I only drink beer on days ending with 'y'), and I will eliminate my reference to swap in my /etc/fstab and we can compare any differences.
This is one of the reasons why I like Puppy.

32 GB RAM here. I do have a swap partition of around 48 GB, but I suspend quite frequently. Still, with having around 6 TB storage all told, that's not even 1% of the total, so.....ah, what the hell. This is on the secondary 'data drive', NOT the primary SSD.

(Before anyone says it, I know it's only hibernation that supposedly wants swap. Truth to tell, I'm not entirely certain WHAT this HP desktop does - suspend OR hibernate; it could even be some weird 'hybrid' of the two for all I'm aware. What I DO know is that whenever I pause things overnight, it insists on mirroring the entire contents of RAM to a single, contiguous location, regardless of how much - or how little - is actually in use. If the swap area is not big enough - I have a couple of smaller swap areas in various locations, as well - such that what's in RAM would have to be split into smaller chunks, it never, ever 'recovers' correctly.

Maybe it IS hibernation. I don't really care; it does what I want, and that's good enough for me. Yet it's definitely
called by a suspend script, so.....)

Sheesh. I've long since given up worrying about it. It works.....and that's the main thing.

------------------------------

I've had swappiness dialled down to "10" for a long time.

-----------------------------

As Puppies have evolved over time, they've gradually become larger, too. That's inevitable, given that apps, dependencies, etc, have all had extra functionality added over the years, and additional background service, daemons, log services, etc, have also been added.

Even so, running even the current Puppies, plus one of the Chromium-based browsers with half-a-dozen tabs open (remember these have individually sandboxed tabs, so use more RAM for that).......on a day-to-day basis, this normally shows around 30.1 GB RAM as still being free, out of a total available of 31.9. Around 1.8 GB in total.....and NO swap used. Which effectively means there's still 30 GB for me to use as I see fit.

(That 1.8 GB includes the whole of Puppy, 'cos it all loads into and runs from RAM. Not just whatever the OS "pulls" off the hard drive as & when It needs it...)

------------------------------

More than half of the OP's RAM.....and ALL of their swap in use? Something's definitely not right there.


Mike. :confused:
I noticed the RAM/SWAP situation a while ago too. Sure seemed weird, but I was actually expecting the entire RAM to be used most of the time since I was told that "for Linux, RAM that is not used is wasted", so greater consumption of that resource seemed normal to me. Now, it is worth noting that I do a lot of multitasking, running 3 IDEs, 30 Firefox tabs, a bunch of other programs in the background, and whatnot. So my hypothesis regarding swap was that the OS just dumped stuff that I wasn't using for a while. Meanwhile, I'll do some Googling regarding swappines.
 
Look, there is a difference between turning a desktop PC into a server, refusing it its constitutional right to reboot from time to time, AND running it for a week or two and happily rebooting it when it asks for it. And that's what I do! I don't mind rebooting my PC after a critical update.

What I do mind, however, is false advertising! I see a button for sleeping, I click that button, and I expect PC to peacefully go to sleep, and - pay attention, this is a crucial part - I expect it to work after waking up. Amazing, right?

View attachment 15429
And it does not really matter whether it is a Windows or Linux machine. Like, imagine having a car that electrocutes you every time you roll down the window, and then imagine going to the repair shop, telling the guy there that there's a problem with a window, and he tells ya "welp, don't do it then". WTF, it's completely ridiculous.
Change the car then.

I don't torrent anymore, but even when I did, it must be kTorrent - kTorrent ya, KDE nay.
 
@ML_113 :-

Actually, that I agree with. I use a few KDE apps myself - Skanlite, KSnip, and DigiKam (the AppImage is large, it's true, but it does contain absolutely everything needed to run; this is one of those AppImages that's been packaged "properly").....but I do NOT want the whole of the Plasma DE installed every time!

Skanlite is the easiest-to-use scanner app ever. Stat. KSnip is a very neat screenie-cum-image editor app, and as for DigiKam, well.....with somewhere in excess of 8,000 images + to organise, it's the bee's knees, as far as I'm concerned. Nothing else even comes close. All of these are available in AppImage format, and all run without issue.


Mike. ;)
 
Change the car then.

I don't torrent anymore, but even when I did, it must be kTorrent - kTorrent ya, KDE nay.
This answer shows nothing but a complete lack of understanding of the problem. This has to be the most useless advice I've heard in some time and almost as moronic as the infamous "if you're homeless, just buy a house". Why even bother joining the discussion and posting such an absurd response? The only reason I can think of is pure, childish arrogance and the need to create confusion - otherwise known as trolling. Shame.
 
Kind of like this post? How about if you cool it with the insults.
Another one, eh? How about you go with your off-topic crusade somewhere else?

You have a pretty toxic community here, I won't lie. Sure, some of you have been really helpful - and I thank them for that, but then a fellow like this comes along and gives a terrible name to the whole community.
 
oh dear....another member dared to not tell you what it is you wish to hear

Cool it with the insults sounds like very good advice to me. Nothing moronic about it.

This community toxic?....at the risk of trotting out a well worn cliche....you must be joking.

The advice offered here is well meant.....and comes from experience. The fact that you dont like it or do not agree is fine....there is no need to "take your swipe" when you disagree or think you know otherwise.
 
oh dear....another member dared to not tell you what it is you wish to hear

Cool it with the insults sounds like very good advice to me. Nothing moronic about it.

This community toxic?....at the risk of trotting out a well worn cliche....you must be joking.

The advice offered here is well meant.....and comes from experience. The fact that you done like it or do not agree is fine....there is no need to "take your swipe" when you disagree or think you know otherwise.

Which part of my problem do you not understand? I ain't no native English speaker, so maybe there is some miscommunication here. Let me explain it again, in the simplest English I know, okay? Just for you folks with special needs.

1. I am using Kubuntu 22.04.2 LTS x86_64, no dualboot.
2. OS performance is getting worse and worse over time. After 2-3 days of uptime, the OS can suddenly freeze and is unusable.
3. i want to find out why this is happening. I am looking for places where I can find answers.
4. I'm not interested in dumb advice that tries to hide the problem instead of fixing it. (!)

Don't you get it? No matter how well you hide the problem, it is STILL THERE. It's not going to magically disappear and - believe it or not - Linus Torvalds is not going to come and fix it for you while you're sleeping, okay? Now this is important, because if you ignore it, THERE WILL BE a time when it comes back and kicks you in the ass with double the force - I learned this the hard way.

So, while we're sharing our great advice with each other, how about I give you one: solve problems instead of ignoring them. Are you folks Americans by any chance? Because this is such an American way of solving problems: pretend they don't exist.

I think there is nothing more to add on my part. Adieu!
 
Alright...

I'm locking this silliness and an admin may be along to either open it again, add to it, or delete it.

I'm indifferent about OP's problem - but there's one thing I'm not going to allow and that's repeated verbal abuse of our regular helpers, or anyone really. That sorta behavior just can't happen here.
 
...an admin may be along to either open it again, add to it, or delete it.

I endorse @KGIII 's action (as I usually do), and I will likely add to it two (2) additional posts while the thread remains locked.

The first will have content which may prove of use to the OP.

The second will be some pointers on site etiquette.

I particularly liked (not), the comment
Just for you folks with special needs.

... as I have eight (8) mental health disorders.

I will likely add the posts in my morning, that is, before I indulge in a beer.

Stay cool, all.

Chris Turner
wizardfromoz
 
@@username

Possible help.

This from

https://help.ubuntu.com/community/SwapFaq

in part,

What is swappiness and how do I change it?​

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

  • swappiness can have a value of between 0 and 100
  • swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
  • swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache
The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment. Note: Ubuntu server installations have different performance requirements to desktop systems, and the default value of 60 is likely more suitable.

To check the swappiness value

cat /proc/sys/vm/swappiness
To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with

sudo sysctl vm.swappiness=10
To make a change permanent, edit the configuration file with your favorite editor:

gksudo gedit /etc/sysctl.conf
Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:

vm.swappiness=10
Save the file and reboot.

With the line

gksudo gedit /etc/sysctl.conf
… that is for Ubuntu Desktop.

For Kubuntu, you can use either a console-based text editor such as nano or vim, or if you wish to use a GUI, use Kate.
kate /etc/sysctl.conf

That will open the file and you can make changes, at the end, to save the changes it will require your sudo password.

Also from me -

SWAPOFF

If you want to experiment with swap off, first enter the following

free -m

and note the output

Then

swapoff -a

followed by

free -m and note the output and compare

IF YOU WANT TO REMOVE THE SWAP FEATURE

There will be a line in your file /etc/fstab which looks similar to this

UUID=735b3be3-779c-4d21-a944-b033225f3ab4 none swap sw 0 0

The UUID will differ.

You can experiment with it by placing a comment (#) at the beginning like so

#UUID=735b3be3-779c-4d21-a944-b033225f3ab4 none swap sw 0 0

and save, then reboot.

Once you are in a desktop session again, run

free -m

Wizard
 
THE RIOT ACT

@@username

When you joined, only a few days ago, you agreed to our Terms and Conditions.

There are only eight (8) paragraphs of those (one with just one line), compared to other sites that is very relaxed.

One of them says

You agree to not use the Service to submit or link to any Content which is defamatory, abusive, hateful, threatening, spam or spam-like, likely to offend, contains adult or objectionable content, contains personal information of others, risks copyright infringement, encourages unlawful activity, or otherwise violates any laws. You are entirely responsible for the content of, and any harm resulting from, that Content or your conduct.

You have breached that rule, with your above.

We also have in the first Thread in our Off Topic readme

Political, religious or racial discussions, gender and sexual preferences do not belong on this board.

Take it that that can be applied across the site, and that further, it includes disparaging comments against nations and their cultures.

If you wish for this Thread to be reopened and/or to take a constructive and meaningful part in our community, you can start a conversation with me to commit to that, and I/we (Staff) will consider that.

Thank you for reading.

Chris Turner
wizardfromoz
 
Status
Not open for further replies.

Members online


Top