I am using Ubuntu 18.04 and since few weeks (I cannot say when exactly), my system is experiencing freezes when there are disk I/Os.
My system is installed on an ext4 partition of a SSD.
Even if the load is not very high, some short freezes occur, mouse moves are no longer smooth, Plasma is responding slowly, apps are often in "waiting for disk" state.
This happens for any kind of disk use : software launches, file transfer. When the system starts swapping, it becomes almost unusable.
There is no error in SMART report and I am using Windows on the same disk without anything comparable, so it should not be a hardware problem.
I have checked the partition offset and changed the IO scheduler (https://blog.vacs.fr/index.php?post/2010/08/28/Solving-Linux-system-lockup-when-intensive-disk-I/O-are-performed), and it remains the same.
I have the impression that it is linked to the interruptions management, but I don't know how to check that.
I am now running out of ideas and I hope you may help!
EDIT:
sysctl vm.swappiness
vm.swappiness = 60 #default
free -h (at startup)
total used free shared buff/cache available
Mem: 3.8G 780M 1.6G 117M 1.4G 2.6G
Swap: 3.7G 0B 3.7G
I found a repeatable way to create this freeze with a partition scan with GParted. At startup there is no problem but freezes seem to appear when the first bytes are written on swap. I am checking my swap configuration.
EDIT 2:
The problem appears very quickly. With this memory usage, it is already freezing:
total used free shared buff/cache available
Mem: 3.8G 1.7G 530M 267M 1.5G 1.5G
Swap: 3.7G 48M 3.7G
From the comments...
After playing around with vm.swappiness=80, we decided to try a newer kernel. We downloaded 5.5.6 from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.5.6/, and so far the machine is working fine!
Ultimately, based on the user's normal apps, Firefox with 15 tabs, and an IDE, more RAM might very well be needed. Install RAM in matched pairs of equal type/size RAM to take advantage of memory interleaving. ie: 2 x 4G RAM, or 2 x 8G RAM.
(low reputation doesn't allow commenting...)
Ever found a way to mitigate this? Seems like it describes this same issue I'm having on Debian.
I'm also having I/O Disk problems in Debian. It's so weird because I don't even know how to describe the issue, is difficult searching for solutions when you don't know what exactly to search.
It seems like there are other people using Debian complaining about severe I/O problems as well. (for years too)
Something is "locking up" the entire I/O system.
I don't suffer these problems in Manjaro, could you make a test in Manjaro to see if it behaves differently there? (so we can be sure that it's an issue with Debian itself)
In my case, it's Cities Skylines, a C#/DotNet application that is having issues (DotNet games will claim all your memory and swap space regardless of the amount you have)
Screenshots with more detail for context:
https://imgur.com/a/x7LkOvV
It would be nice if someone knew of command-line launch parameters that I could use with C# applications in order to make more tests, or to somehow limit the amount of disk threads it needs. The disk seems to be overwhelmed with requests, it looks like that.