From time to time the computer starts to work very slowly. This happens suddenly and I could not identify a connection with other activities.
Symptoms:
Keyboard lag: After switching keyboard layouts, there is a 1-second delay in which typed characters do not appear on the screen. Once the lag resolves, all typed characters appear at once. Continued typing exhibits no lag, with characters appearing immediately (around 50ms) after pressing the key. In normal mode, there is no lag.
Alt+Tab lag: When quickly pressing Alt+Tab, the window of another program appears with a slight but noticeable delay (around 300-500ms). In normal mode, switching occurs instantly.
Input lag: Typing lag in any input field occurs sporadically. This seems to happen when switching to an application from another application and starting to type in an input field. For example, pressing the Super key and starting to type in search input.
Gmail navigation lag: Clicking on an email header results in a 0.5-second delay before the email loads. Clicking on Inbox in the left menu takes about 2 seconds for the list of emails to display. In normal mode, switching occurs instantly (around 100-200ms) and there is no noticeable lag.
Lag in other applications: Lag is also observed in other applications (Slack, Obsidian, RubyMine).
Overall low interface responsiveness: The overall responsiveness of the interface is low.
Additional details:
I use the laptop for work. The processor is often loaded because I frequently compile and lint JavaScript projects. RubyMine, Node, Chrome, and Docker are almost always running, and I generally don't experience performance issues.
I have tried closing all windowed applications, but this does not help.
I have tried disabling and enabling Wi-Fi, but this has no effect.
No network drives are connected.
Top does not show significant CPU load. Even during normal system operation, when the overall CPU load is over 50%, it has almost no impact on interface responsiveness.
Restarting the computer resolves the issue. The computer boots up very quickly (20 seconds). The problem may not manifest for weeks, but then suddenly the Ubuntu interface becomes very unresponsive. This persists until I restart the laptop.
There are no mentions of disk problems in the logs.
Similar effects occur when I switch power to Power Saver mode. However, even in Power Saver mode, the interface is more responsive.
I ran ps aux when Ubuntu was running slowly and after restarting. I did not notice any significant difference in the list of running applications.
sysbench running at a time when the system was slow
sysbench launched after reboot in Performance mode
sysbench launched after reboot in Power Saver mode
I would appreciate any help in identifying the cause of these random slowdowns and finding a solution to prevent them.
Additional information:
- Ubuntu: 22.04.1 LTS
- MSI Katana GF66 12UE
- Intel i7 12700H
- 64GB RAM
- Graphics: Nvidia GeForce 3060 6GB
- Samsung SSD 980 PRO 1TB, WDC PC SN540 SDDPNPF-512G-1032
# uname -a Linux vpkatana 6.5.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 12 10:22:43 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
# sysctl vm.swappinessvm.swappiness = 0
Update 18.04.2024
It is noteworthy that the sysbench shows a huge difference in the “events per second” indicator: 458.19 vs 2990.47 It's as if something is severely limiting the processor.
Update 19.04.2024
I have set up a minute-by-minute collection of the events per second indicator using systbench (sysbench cpu --threads=1 run | grep "events per second:" | awk '{print $4}'
). The system worked for almost a day with normal performance, but at some point (at 19:45) switched to slow mode. I was not using a computer at that moment.
Update 24.04.2024
I was able to find out that this is a known problem and it is associated with lowering the processor frequency. Here are some links that may help you dive into the problem and try different solutions. I'm still in the process of researching.