Manjaro is slow and lagging sometimes

My system is slow and lagging sometimes.
Lagging happens when I use chrome or firefox, vs code or webstorm, have multiple http servers running or running unit tests (100+) at the same time. Also, I have docker installed and usually during work I have minimum 2 containers running. Usually when system starts lagging it kills webstorm, vs code and chrome processes.
Previously I was using ubuntu and never had problem with the same workload.

I think problem is related to GPUs and drivers but not sure.

System info:
memory: 16.0 GiB
cpu: Intel® Core™ i7-10750H × 12
gpu: Mesa Intel® UHD Graphics (CML GT2), NVIDIA GeForce RTX 3060 Laptop GPU
disk: SSD 512.1 GB
OS build ID: rolling
Kernel: linux61
Gnome version: 43.3
Windowing system: X11

sudo inxi --admin --verbosity=7 --filter --no-host --width                                                                                                                                          ✔ 
System:
  Kernel: 6.1.12-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=d65156d0-e65e-40b9-85ef-3d1d60dbf387 rw nouveau.modeset=0 quiet
    splash apparmor=1 security=apparmor udev.log_priority=3
  Desktop: GNOME v: 43.3 tk: GTK v: 3.24.36 wm: gnome-shell dm: GDM v: 43.0
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: Acer product: Predator PH315-53 v: V2.00
    serial: <filter>
  Mobo: CML model: QX50_CMS v: V2.00 serial: <filter> UEFI: Insyde v: 2.00
    date: 01/08/2021
Memory:
  RAM: total: 15.46 GiB used: 4.96 GiB (32.1%)
  Array-1: capacity: 16 GiB slots: 2 EC: None max-module-size: 8 GiB
    note: est.
  Device-1: ChannelA-DIMM0 type: DDR4 detail: synchronous size: 8 GiB speed:
    spec: 3200 MT/s actual: 2933 MT/s volts: curr: 1.2 min: 1.35 max: 1.35
    width (bits): data: 64 total: 64 manufacturer: Micron
    part-no: 8ATF1G64HZ-3G2J1 serial: <filter>
  Device-2: ChannelB-DIMM0 type: DDR4 detail: synchronous size: 8 GiB speed:
    spec: 3200 MT/s actual: 2933 MT/s volts: curr: 1.2 min: 1.35 max: 1.35
    width (bits): data: 64 total: 64 manufacturer: Micron
    part-no: 8ATF1G64HZ-3G2J1 serial: <filter>
CPU:
  Info: model: Intel Core i7-10750H socket: U3E1 bits: 64 type: MT MCP
    arch: Comet Lake gen: core 10 level: v3 note: check built: 2020
    process: Intel 14nm family: 6 model-id: 0xA5 (165) stepping: 2
    microcode: 0xF4
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 2588 high: 2801 min/max: 800/5000 base/boost: 2574/8300
    scaling: driver: intel_pstate governor: powersave volts: 0.8 V
    ext-clock: 100 MHz cores: 1: 2725 2: 2600 3: 2801 4: 2600 5: 2000 6: 2800
    7: 2532 8: 2600 9: 2600 10: 2600 11: 2600 12: 2600 bogomips: 62431
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush
    clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu
    fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs
    ibrs_enhanced ida intel_pt invpcid invpcid_single lahf_lm lm mca mce
    md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx ospke pae pat
    pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pku pln pni popcnt pse pse36 pts
    rdrand rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1
    sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust
    tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt
    xsaves xtopology xtpr
Graphics:
  Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Acer Incorporated ALI
    driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20
    ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:9bc4
    class-ID: 0300
  Device-2: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q]
    vendor: Acer Incorporated ALI driver: nvidia v: 525.89.02
    alternate: nouveau,nvidia_drm non-free: 525.xx+
    status: current (as of 2023-02) arch: Ampere code: GAxxx
    process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 01:00.0 chip-ID: 10de:2520
    class-ID: 0300
  Device-3: Quanta HD User Facing type: USB driver: uvcvideo bus-ID: 1-5:3
    chip-ID: 0408:a061 class-ID: 0e02
  Display: server: X.org v: 1.21.1.7 with: Xwayland v: 22.1.8
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia
    unloaded: nouveau alternate: fbdev,nv,vesa dri: iris gpu: i915
    display-ID: :1 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-size: <missing: xdpyinfo>
  Monitor-1: eDP-1 model: BOE Display 0x08b3 built: 2019 res: 1920x1080
    hz: 144 dpi: 142 gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 398mm (15.7")
    ratio: 16:9 modes: 1920x1080
  API: OpenGL v: 4.6 Mesa 22.3.5 renderer: Mesa Intel UHD Graphics (CML GT2)
    direct-render: Yes
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 476.94 GiB used: 40.04 GiB (8.4%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: PC SN730
    SDBQNTY-512G-1014 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 11101100 temp: 24.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 476.64 GiB size: 468.09 GiB (98.21%) used: 40.04 GiB (8.6%)
    fs: ext4 block-size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2 label: N/A
    uuid: d65156d0-e65e-40b9-85ef-3d1d60dbf387
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 312 KiB (0.1%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p1
    maj-min: 259:1 label: N/A uuid: 7A81-0D03
Swap:
  Alert: No swap data was found.
Unmounted:
  Message: No unmounted partitions found.

p.s. when lagging happens, it does not seem that CPU, GPU, RAM utilization is very high (I monitor using nvtop)

1 Like

my linux/arch knowledge is not advanced and idk how to approach these kind of issues. I am just a backend dev. Would appreciate if you can advice how to debug and understand what causing the issue.
Thanks

Dump question, but do you have a swapfile/partition? That kinda happens when your ram is full and oomd decides to kill some applications for stability reasons.

Maybe you had a swapfile?

maybe the first line of argument after all others are extinguished is checking if manjaro vs. ubuntu have different default priorities on processes.

Having something at 0 or -20 can make all the difference. Especially when under load.

Welcome to Manjaro! :smiling_face_with_three_hearts:

  1. Please read the information behind this link. It will help you to post necessary information.

[HowTo] Provide System Information

  1. Please press the three dots below your post and then press the :pencil2:
  • If you give us information about your system, we can see what we’re talking about and make better suggestions.
  • You can do this by using inxi in a terminal or in console.
sudo inxi --admin --verbosity=7 --filter --no-host --width
  • Personally identifiable information such as serial numbers and MAC addresses are filtered out by this command
  • Presenting the information in this way allows everyone to be familiar with the format and quickly find the items they need without missing anything.
  1. Copy the output from inxi (including the command) and paste it into your post.
  • To make it more readable, add 3 backticks ``` on an extra line before and after the pasted text.

(Wisdom lies in reading :wink: )

1 Like

actually idk, how to check that?

free -h
htop
swapon -s

I’m not using dual system, just Manjaro

…or

$ lsblk

“There’s more than one way to skin a cat.”

1 Like

@gegham Please don’t be lazy and use copy&paste for terminal outputs. Markdown is supported here. thanks :wink:

So there is no swap as expected. If your system is running at full load, then it needs a swap. Maybe have look at systemd-swap which dynamically creates and activates swap files if needed.

1 Like

@megavolt sure it’s not hard for me to do that. will start systemd-swap deamon. Thanks.

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0  55.6M  1 loop /var/lib/snapd/snap/core18/2697
loop1         7:1    0 116.8M  1 loop /var/lib/snapd/snap/core/14784
loop2         7:2    0  65.1M  1 loop /var/lib/snapd/snap/sublime-text/116
loop3         7:3    0  63.3M  1 loop /var/lib/snapd/snap/core20/1822
loop4         7:4    0  49.8M  1 loop /var/lib/snapd/snap/snapd/18357
loop5         7:5    0 198.1M  1 loop /var/lib/snapd/snap/postman/196
loop6         7:6    0 605.5M  1 loop /var/lib/snapd/snap/webstorm/298
loop7         7:7    0     4K  1 loop /var/lib/snapd/snap/bare/5
loop8         7:8    0  91.7M  1 loop /var/lib/snapd/snap/gtk-common-themes/1535
loop9         7:9    0  68.7M  1 loop /var/lib/snapd/snap/notion-snap/16
loop10        7:10   0 164.8M  1 loop /var/lib/snapd/snap/gnome-3-28-1804/161
nvme0n1     259:0    0 476.9G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
└─nvme0n1p2 259:2    0 476.6G  0 part /

@megavolt I followed this guide and configured systemd-swap. Will let you know about the results.
Thanks man.

@megavolt Swap file is created but the issue still exists

swapon --show                                                                                                                                                           
NAME                                                 TYPE    SIZE     USED     PRIO
/var/lib/systemd-swap/swapfc/1 file        256M   0B          50
 df -h                                                                                                                                                                          ✔ 
Filesystem      Size  Used Avail Use% Mounted on
dev             7.8G     0  7.8G   0% /dev
run             7.8G  2.2M  7.8G   1% /run
/dev/nvme0n1p2  469G   42G  404G  10% /
tmpfs           7.8G   87M  7.7G   2% /dev/shm
tmpfs           7.8G   43M  7.7G   1% /tmp
/dev/loop0      128K  128K     0 100% /var/lib/snapd/snap/bare/5
/dev/loop5       56M   56M     0 100% /var/lib/snapd/snap/core18/2697
/dev/loop4       69M   69M     0 100% /var/lib/snapd/snap/notion-snap/16
/dev/loop9       50M   50M     0 100% /var/lib/snapd/snap/snapd/18357
/dev/loop2      165M  165M     0 100% /var/lib/snapd/snap/gnome-3-28-1804/161
/dev/loop1       92M   92M     0 100% /var/lib/snapd/snap/gtk-common-themes/1535
/dev/loop6      199M  199M     0 100% /var/lib/snapd/snap/postman/196
/dev/loop7       64M   64M     0 100% /var/lib/snapd/snap/core20/1822
/dev/loop3      117M  117M     0 100% /var/lib/snapd/snap/core/14784
/dev/loop10     606M  606M     0 100% /var/lib/snapd/snap/webstorm/298
/dev/loop8      198M  198M     0 100% /var/lib/snapd/snap/postman/197
/dev/loop11      66M   66M     0 100% /var/lib/snapd/snap/sublime-text/116
/dev/nvme0n1p1  300M  312K  300M   1% /boot/efi
tmpfs           1.6G  124K  1.6G   1% /run/user/1000

@gegham So if swapping wasn’t the issue, see what @varikonniemi has already said about priorities. It could be perfectly legitimate for a process to have a high priority and make the lower priority applications wait a long time and causing it to crash.

I cannot say what the difference between Ubuntu and Manjaro is, but at least it must be the default kernel version, which is, when I remember correctly, version 5.15. You run v6.1.

Also check with iotop or iotop-c if the Input/Output performance let it crash.

There are tools like nice, renice or ionice which can adjust the priorities to your needs. Docker has its own parameters for that.

Maybe, I am not sure, it could be also a snap issue. While you can run snaps on Manjaro, it is not optimized for that. Snaps are generally optimized and tested for Ubuntu and for sure, it has always a delay when computing.

You can replace sublime-text, postman, webstorm with Flatpaks or just install it natively from the official repo or the AUR.

1 Like

Get rid of the snaps - each end every one.

Then disable snap.

postman can be build from AUR using

pamac build postman-bin

sublime-text has their own repo you install from

curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
sudo pacman -Syu sublime-text

Webstorm can be setup to run in your home

curl -O https://download.jetbrains.com/webstorm/WebStorm-2022.3.2.tar.gz
tar -xf WebStorm-2022.3.2.tar.gz
./WebStorm-223.8617.44/bin/.webstorm.sh
3 Likes

@megavolt @linux-aarhus thanks for answers. I removed all snap apps and also removed snapd itself.
Will let you know if it solves the problem. Thanks!

with systemd snap and flatpak linux is quickly becoming a mess similar to windows, with huge effort going into working around complex configuration and problems arising from containerization

1 Like

seems removing snaps solved the problem… I have been working with the same workload for couple of hours and didn’t experience any lagging. Thank you all!

2 Likes