System overall performance issue

Hello, I have noticed performance issues since Manjaro installation ~1 year back.
Animations are laggy, moving windows is laggy too, (in world of warcraft i noticed big tearing but fps was good, if it helps solving problem), switching windows is slow, opening appdrawer takes time, then it come in with laggy animation... even scrolling in google-chrome is bit laggy
when i reboot, it is for few minutes better, then it goes to hell.
another issue which i found is when i copy more data from 1 external HDD to 2nd external HDD, from start speed is great, ~100MB/s then it drop to USB2.0 speed limit of 2nd HDD and desktop is sometimes unresponsive, laggy, sometimes it cause freeze, i could not even move with mouse. i found that mount.ntfs was using ~15% CPU. but I remember that some time before, I was copying data to/from my manjaro HDD and it cause this problem too. Bigger the copy speed is, issues are worse.
Sometimes starting VM's in virtualbox cause freeze on VM booting system, so i need to reboot whole notebook.
I found that i have 3GiB in swap now, but memory is filled by 67% (5.2/7.7GB), is this normal behaviour?

Manjaro was installed with official gnome, stable channel, with encryption (automatic config from installer), on /dev/sdb

Today i needed to diagnose customer's PC, so i used manjaro bootable USB (same image that I used to install manjaro on my system) and it was performing great in live environment, without tearing, lagging, everything was smooth like in different universe... that points me to this thread.
computer was i3 4th gen, 4GB RAM and integrated GPU, which should be in performance same as mine notebook or not?

can you help me resolve this issue?
running on xorg, gnome 3.30, gpu drivers are correct i think...
I don't even know where to start...

inxi -Fxxxz output:

System:    Host: xxxxxx Kernel: 4.14.74-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 Desktop: Gnome 3.30.1 
           wm: gnome-shell dm: GDM 3.30.0 Distro: Manjaro Linux 
Machine:   Type: Laptop System: HP product: HP ProBook 440 G3 v: N/A serial: <filter> Chassis: type: 10 
           serial: <filter> 
           Mobo: HP model: 8100 v: KBC Version 40.71 serial: <filter> UEFI: HP v: N78 Ver. 01.27 
           date: 05/22/2018 
Battery:   ID-1: BAT0 charge: 49.9 Wh condition: 51.6/51.6 Wh (100%) volts: 11.9/10.7 
           model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: Discharging 
CPU:       Topology: Dual Core model: Intel Core i5-6200U bits: 64 type: MT MCP arch: Skylake rev: 3 
           L2 cache: 3072 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19204 
           Speed: 400 MHz min/max: 400/2300 MHz Core speeds (MHz): 1: 467 2: 432 3: 400 4: 400 
Graphics:  Device-1: Intel Skylake GT2 [HD Graphics 520] vendor: Hewlett-Packard driver: i915 v: kernel 
           bus ID: 00:02.0 chip ID: 8086:1916 
           Display: x11 server: X.org 1.20.1 driver: i915 compositor: gnome-shell 
           resolution: <xdpyinfo missing> 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2) v: 4.5 Mesa 18.2.2 compat-v: 3.0 
           direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 00:1f.3 chip ID: 8086:9d70 
           Sound Server: ALSA v: k4.14.74-1-MANJARO 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard 
           driver: r8168 v: 8.045.08-NAPI port: 3000 bus ID: 01:00.0 chip ID: 10ec:8168 
           IF: enp1s0 state: down mac: <filter> 
           Device-2: Intel Wireless 3165 driver: iwlwifi v: kernel port: 3000 bus ID: 02:00.0 
           chip ID: 8086:3165 
           IF: wlp2s0 state: up mac: <filter> 
Drives:    Local Storage: total: 685.61 GiB used: 171.85 GiB (25.1%) 
           ID-1: /dev/sda vendor: Kingston model: SHSS37A480G size: 447.13 GiB speed: 6.0 Gb/s serial: <filter> 
           rev: 00.Y scheme: GPT 
           ID-2: /dev/sdb vendor: SanDisk model: SD7SN6S-256G-1006 size: 238.47 GiB speed: 6.0 Gb/s 
           serial: <filter> rev: 1006 scheme: GPT 
Partition: ID-1: / size: 224.77 GiB used: 168.89 GiB (75.1%) fs: ext4 dev: /dev/dm-0 
           ID-2: swap-1 size: 8.80 GiB used: 2.95 GiB (33.6%) fs: swap dev: /dev/dm-1 
Sensors:   System Temperatures: cpu: 41.0 C mobo: 0.0 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 314 Uptime: 4d 3h 06m Memory: 7.69 GiB used: 4.30 GiB (55.9%) Init: systemd v: 239 
           Compilers: gcc: 8.2.1 Shell: bash v: 4.4.23 running in: guake inxi: 3.0.26 

Is this inxi yours or the customers?

mine, of course.

Its hard to guess because we cant rule out a fractured install. Or what packages have been installed, or configurations made.. you get the idea.

I can suggest a thing for the skylake though.
You can try adding the following to boot parameters:
i915.enable_guc=3

Another thing you might try is running with modesetting alone, instead of the intel graphics driver.

What did you change a year back?

Have you done the basics like checking running processes with top or htop?

Have you been installing dodgy Kodi plugins which have added cryptominers to your system?

I am assuming LUKS encryption. This could be the source of your slow downs during write operations. On top of that unless it is specifically setup you are probably not performing trim operations regularly. I recommend you read the dm-crypt section of this page https://wiki.archlinux.org/index.php/Solid_state_drive , if you are not trimming your SSD this would deifnitely slow things down.

Yes this is normal behavior.

Another potential problem point is that Skylake Processor Integrated Graphics have had some issues reported. Try switching to modesetting, by either chnaging the configuraiton file or simply remove I believe intel-x86-video package (sorry cant be sure right now, not on a Manjaro machine) and poweroff. Start up the machine and it chould be using modesetting, this may also resolve your issue. Also please provide a list of extensions you are using some of them could easily be causing you issues. You can try running gnome with all extensions off, and then reenable them one by one. If you list them some obvious choke points might present themselves.

jonathon: year back manjaro was installed, and yes, I am checking system but any of processes had unusual usage, except gnome-shell, but it's somewhat hungry process...
and i don't like kodi :slight_smile:

nadb: sure, LUKS have some impact on my system but I don't think that it will cause animations laggy-unresponsive and problems with copying data between two other HDD (both unencrypted)
thanks for TRIM info, idk that i need to set it up manually.
in fstab, root luks partition have discard option, does it mean that periodic trim is enabled?

well, as I am typing, problem with lags was solved by removing xf86-video-intel package and rebooting.

I personally think luks and using the NTFS file system are the 2 most likely suspects for your file transfer issues. The only way to know for sure would be to eliminate both from your system.

Obviously that's not something you want to do with your desire for encryption. In the case of NTFS it is certainly doable. I would convert your external drive to ext4 and see if the issue persists. NTFS is not a good file system for Linux.

1 Like

If you read the link I sent you would know to check and make sure your /etc/crypttab has the discard option in the file. Discard in the fstab does serve the same purpose however in some instances it is not recommended. I recommend you read up on it and come to your own conclusion. I personally use hardware encryption, as LUKS can frustrate your personal recovery attempts, however if you are worried about a Govt adversary I would not completely trust hardware encryption, and move to LUKS for starters or rather I would be running something like Qubes. Personally LUKS is overkill, and remember when you are logged in everything LUKS is encrypting is decrypted.

Happy to see it was xf86-video-intel as to your transfer rates once again luks could be impacting it but as @tbg noted the NTFS would be a bigger issue. NTFS is a crap file system for using with linux systems.

1 Like

thanks, but how is discard different using it in fstab and crypttab?
i have in fstab on root partition discard option for now.

https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard.2FTRIM_support_for_solid_state_drives_.28SSD.29

IIRC periodically running fstrim is preferred over the discard fs mount option.

so according to arch wiki, i should remove discard from fstab, add discard option to crypttab, add kernel parameter to grub config and enable fstrim.timer? it is confusing me, i don't speak english good enough..

1 Like

And convert everything over to a Linux FS. :wink:

I have an older Dell laptop with a Haswell CPU and a 5400 RPM spinner running Plasma. I transfer probably 50-100 GB at a gulp between it and a 10 year old detached 4500 RPM spinner via USB, and don't have any unresponsiveness. And stream HD video from Amazon Prime while doing so.

GPT/EFI, 8 GB RAM, 4 GB Swapfile, dedicated /home partition.

Unless you need the external drives in NTFS for Windows compatibility, I would convert them ASAP. And if you are running Windows, you might be better off transferring large amounts of data between 2 NTFS-formatted drives while running in it, instead of Linux.

Of LUKS, I know nothing.

regards

2 Likes

I don't want to screw things, can somebody help me with configuration?

Generally speaking discard option is continuous trim and not recommended. Problem is I am unsure if LUKS allows for periodic trim.

I think you need to really assess your security stance, what you are hoping to accomplish with the LUKS encryption, and whether it is worth the extra potential issues. So what are your security concerns and what are you looking to accomplish with full diisk encryption?

Regardless I would start by imaging using clonezilla and creating a backup before you play with anything. Another concern are you using LVM? This makes things a little more complicated.

(Also I apologize if I came across as a pedantic jackass. I did not realize you were dealing with a language barrier as regards the Archwiki.)

1 Like

so I have:
removed discard parameter for ssd's in /etc/fstab
add discard option to /etc/crypttab/ for each line
add :allow-discards at the end of cryptdevice line to grub config
add rd.luks.options=discard at the end of line in grub config
enable fstrim.timer

tested with command "sudo fstrim /"
but it gives me no output to terminal, is that OK?
before it gives me error that this partition could not be trimmed or something like that.

You should get:

sudo systemctl status fstrim.timer
[sudo] password for htpc: 
● fstrim.timer - Discard unused blocks once a week
   Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: disabled)
   Active: active (waiting) since Tue 2018-10-16 01:48:56 MST; 1 day 16h ago
  Trigger: Mon 2018-10-22 00:00:00 MST; 4 days left
     Docs: man:fstrim

I would try it with the -v option for verbose. This should provide output. Generally speaking using the fstrim -av option will trim the entire disk with verbose output. The command shown by @tbg will let you know if the timer is enabled.

Forum kindly sponsored by