System sluggish until after suspension!

Hi guys!
I have a problem regarding my laptop.
Upon boot the pc works somewhat fine, but animations and performance in general are a little sluggish, I can’t watch 1080p youtube videos without it lagging and certain programs are just slower than normal. For example, I use GIMP with a graphic tablet for notes when I study and pen input will lag a lot.
The fun thing is, If i suspend the pc and wake it up, even immediatly, all lags and general sluggishness just desappears, youtube videos work fine and so does GIMP and the system feels generally snappier and faster. So I thought that it has something to do with RAM, maybe when I wake up my laptop from sleep a lot of wath it put into RAM remains there, but looking at system monitor before and after suspend doesn’t show more or less ram usage… can’t wrap my head around it!
It’s nothing too serious, it takes like 10 seconds to close and open the laptop lid again, but still it would be even nicer if I didn’t have to do it XD
What do you think about it?

inxi -Fazy
System:
  Kernel: 5.7.19-2-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.7-x86_64 
  root=UUID=5f7a7ef9-ca3d-413a-8734-f763cb82c6ef rw pci=noaer quiet apparmor=1 
  security=apparmor resume=UUID=bc81d4a7-d397-440e-9225-c2eae38cb1df 
  udev.log_priority=3 
  Desktop: KDE Plasma 5.19.5 tk: Qt 5.15.0 wm: kwin_x11 dm: SDDM 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: ASUSTeK product: X541UAK v: 1.0 serial: <filter> 
  Mobo: ASUSTeK model: X541UAK v: 1.0 serial: <filter> 
  UEFI: American Megatrends v: X541UAK.311 date: 03/14/2018 
Battery:
  ID-1: BAT0 charge: 23.2 Wh condition: 29.6/34.6 Wh (86%) volts: 10.8/10.8 
  model: ASUSTeK ASUS Battery type: Li-ion serial: N/A status: Discharging 
  cycles: 354 
CPU:
  Topology: Dual Core model: Intel Core i3-6006U bits: 64 type: MT MCP 
  arch: Skylake family: 6 model-id: 4E (78) stepping: 3 microcode: D6 
  L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 16006 
  Speed: 2000 MHz min/max: 400/2000 MHz Core speeds (MHz): 1: 2000 2: 2000 
  3: 2000 4: 2001 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds status: Vulnerable: No microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel Skylake GT2 [HD Graphics 520] vendor: ASUSTeK driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:1916 
  Device-2: IMC Networks USB2.0 VGA UVC WebCam type: USB driver: uvcvideo 
  bus ID: 1-6:3 chip ID: 13d3:5a01 serial: <filter> 
  Display: x11 server: X.Org 1.20.8 compositor: kwin_x11 driver: intel 
  display ID: :0 screens: 1 
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") 
  s-diag: 414mm (16.3") 
  Monitor-1: eDP1 res: 1366x768 hz: 60 dpi: 102 size: 340x190mm (13.4x7.5") 
  diag: 389mm (15.3") 
  OpenGL: renderer: Mesa Intel HD Graphics 520 (SKL GT2) v: 4.6 Mesa 20.1.7 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: ASUSTeK 
  driver: snd_hda_intel v: kernel alternate: snd_soc_skl bus ID: 00:1f.3 
  chip ID: 8086:9d70 
  Sound Server: ALSA v: k5.7.19-2-MANJARO 
Network:
  Device-1: Realtek RTL810xE PCI Express Fast Ethernet vendor: ASUSTeK 
  driver: r8169 v: kernel port: e000 bus ID: 02:00.2 chip ID: 10ec:8136 
  IF: enp2s0f2 state: down mac: <filter> 
  Device-2: Realtek RTL8723BE PCIe Wireless Network Adapter vendor: Lite-On 
  driver: rtl8723be v: kernel port: d000 bus ID: 03:00.0 chip ID: 10ec:b723 
  IF: wlp3s0 state: up mac: <filter> 
Drives:
  Local Storage: total: 577.55 GiB used: 109.64 GiB (19.0%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/sda vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB 
  block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s serial: <filter> 
  rev: 023 scheme: GPT 
  ID-2: /dev/sdb vendor: Crucial model: CT120BX500SSD1 size: 111.79 GiB 
  block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> 
  rev: R013 scheme: GPT 
Partition:
  ID-1: / raw size: 161.13 GiB size: 157.60 GiB (97.81%) 
  used: 33.80 GiB (21.4%) fs: ext4 dev: /dev/sda5 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 3.91 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/sda7 
Sensors:
  System Temperatures: cpu: 41.0 C mobo: N/A 
  Fan Speeds (RPM): cpu: 2000 
Info:
  Processes: 183 Uptime: 33m Memory: 7.66 GiB used: 1.15 GiB (15.1%) 
  Init: systemd v: 246 Compilers: gcc: 10.2.0 Packages: pacman: 1332 lib: 376 
  flatpak: 0 Shell: Bash v: 5.0.18 running in: konsole inxi: 3.1.05
  1. Kernel 5.7 is EOL please upgrade to an LTS or a higher version.

  2. Suspending will swap optional components to the swap file therefore freeing up more RAM of your other applications.

    However, this is just pure speculation as you did not provide a free --human before and after suspension or an inxi --admin --verbosity=7 --filter --no-host before and after (as that one provides more detailed information than a simple Fazy)

    If you would provide one of the two (free is best) also provide the output of:

    for szFile in /proc/*/status ; do 
      awk '/VmSwap|Name/{printf $2 "\t" $3}END{ print "" }' $szFile 
    done | sort --key 2 --numeric --reverse | head --lines=25
    

    The last one only after suspension.

:innocent:

You should monitor CPU, RAM usage and disk IO upon boot. You can use free for RAM, htop for CPU and iotop for disk IO.

Oh didn’t notice the Kernel was EOL… should I switch to 5.8.11-1 or 5.4.67-1 (the last LTS in manjaro settings manager)?

Anyway, here’s the output before and after suspend:

Before suspend (it was immediatly after boot, the only thing I opened was the teriminal so I could provide cleaner information)
free --human
total used free shared buff/cache available
Mem: 7.7Gi 484Mi 6.4Gi 147Mi 811Mi 6.8Gi
Swap: 3.9Gi 0B 3.9Gi

After suspend
free --human
total used free shared buff/cache available
Mem: 7.7Gi 490Mi 6.1Gi 153Mi 1.0Gi 6.8Gi
Swap: 3.9Gi 0B 3.9Gi

for szFile in /proc/*/status ; do  
>   awk '/VmSwap|Name/{printf $2 "\t" $3}END{ print "" }' $szFile  
> done | sort --key 2 --numeric --reverse | head --lines=25 
zswap1 
zswap1 
zswap-shrink 
xembedsniproxy  0       kB 
xdg-permission- 0       kB 
xdg-document-po 0       kB 
xdg-desktop-por 0       kB 
xdg-desktop-por 0       kB 
writeback 
wpa_supplicant  0       kB 
watchdogd 
upowerd 0       kB 
udisksd 0       kB 
tpm_dev_wq 
thumbnail.so    0       kB 
systemd-udevd   0       kB 
systemd-timesyn 0       kB 
systemd-logind  0       kB 
systemd-journal 0       kB 
systemd 0       kB 
systemd 0       kB 
startplasma-x11 0       kB 
start_kdeinit   0       kB 
sort    0       kB 
soffice.bin     0       kB

If it can help I’ll post the output at the same commands after I update the Kernel!

  1. Yes, please! :innocent:

  2. I need that when it’s getting slow and laggy! :scream: the same with the for szFile in /proc/*/status stuff… :man_shrugging:

  3. Do that first! :wink:

P.S. In the future, when providing code/output, please copy-paste that output in-between 3 backticks ``` at the beginning and end of the code/text so that the output looks like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

instead of like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

(as that makes our life much easier so you get helped more quickly and efficiently)

:innocent:

1 Like

Well, I installed the kernel 5.4.67-1 LTS (5.8 gave me problems with keyboard and trackpad that I don’t have time to fix today) and it seems like it mitigates the problem.
Essentially: now, right after boot, the system is just a little bit slower than after suspend but it’s a lot better than before, pen input in GIMP doen’t lag so it doesn’t require me to suspend the laptop for it to be usable. Youtube on Chrome still lags a bit untill I suspend, expecially on battery power (but I have TLP installed, so on battery power CPU performance are limited to increase battery life and it sometimes causes youtube videos to be laggy). I’ll still post the outputs though

I need that when it’s getting slow and laggy! :scream: the same with the for szFile in /proc/*/status stuff… :man_shrugging:

The fact is that it lags just after I boot, there is not a particular moment when it becomes laggy… anyway I’ll post the output after using some of the programs that are affected the most by this problem so it can be!

Before suspend

free --human 
     total  used   free   shared   buff/cache   available 
Mem: 7.7Gi  1.3Gi  4.8Gi   388Mi       1.5Gi       5.8Gi 
Swap: 3.9Gi 0B    3.9Gi

After suspend

free --human 
     total   used   free   shared   buff/cache   available 
Mem: 7.7Gi   1.6Gi  4.1Gi   482Mi    1.9Gi        5.3Gi 
Swap: 3.9Gi   0B    3.9Gi


for szFile in /proc/*/status ; do    awk '/VmSwap|Name/{printf $2 "\t" $3}END{ print "" }' $szFile ; done | sort --key 2 --numeric --reverse | he
ad --lines=25 
yakuake 0       kB 
xembedsniproxy  0       kB 
xdg-permission- 0       kB 
xdg-document-po 0       kB 
xdg-desktop-por 0       kB 
xdg-desktop-por 0       kB 
writeback 
wpa_supplicant  0       kB 
watchdogd 
upowerd 0       kB 
udisksd 0       kB 
tpm_dev_wq 
thumbnail.so    0       kB 
thumbnail.so    0       kB 
systemd-udevd   0       kB 
systemd-timesyn 0       kB 
systemd-logind  0       kB 
systemd-journal 0       kB 
systemd 0       kB 
systemd 0       kB 
startplasma-x11 0       kB 
start_kdeinit   0       kB 
sort    0       kB 
soffice.bin     0       kB 
sddm-helper     0       kB

These outputs are taken after opening chrome, gimp and libreoffice, the programs I use the most and that are somewhat affected by general lag untill I suspen.
As I said before, after the Kernel update GIMP stopped lagging and the system fells better, even if it’s not quite as fast as after I wake it up from sleep!

ps: sorry for the formatting mistakes from the previous post, I used the </> button but didn’t check before posting…

Chrome is a bad choice on your any hardware: it’s a memory hog! Use Firefox instead…

So no huge memory problems: kernel 5.4 LTS seems to have fixed it.

Meh… No worries.

Looking at all the above, I’ve marked the below answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (I just want to avoid even more subjective opinions being posted and confusing you even more)

:innocent:
P.S. In the future, please mark a solution like this:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

Yeah I really should make the switch to Firefox… unfortunatly my University obliges me to use Chrome for anything related to online exams, so I had to use it during the last couple of months…
No problem with the marked solution, it was in fact the solution!
Really thank you for helping out a noob, have a great day!!

1 Like

:sob:

Give me the email address of your dean! I’ll @#^%* him/her up a bit! :wink: :grin:

For your continued education, please read this:

:innocent:

Have you tried another browser based on the same engine? Like Chromium or Falkon (on repositories)?

I didn’t, mainly because my university, rightfully imo, enforced very strict rules for any exam that we attend from home, so they can be sure that no one cheats. Anyway after what Fabby said I tried using Firefox for a couple of days and noticed a good improvement in performance regarding web related activities, so I made the switch! I’ll still have to use Chrome when attending to exams but I can use whatever browser I want for my daily use and Firefox fits my needs better overall.
And I finally solved all problems regarding Youtube video performance: in chrome, after a lot of messing around, I was able to get ok performance most of the time with occasional video and audio stuttering. In Firefox the simple adding of h264ify returned smooth video and no more audio stuttering… I should have switched a long time ago. Still, I took it as a learning experience!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.