[SOLVED] Hard drive performance issue caused by polling – why?

Forum Forums New users New Users and General Questions [SOLVED] Hard drive performance issue caused by polling – why?

  • This topic has 8 replies, 6 voices, and was last updated Nov 25-12:28 am by scififry.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #71626
    Member
    scififry

    Hello,

    first of all I’d like to say thank you for such a really great distribution without any unnecessary stuff but such an excellent choice of pre-installed applications (especially no PulseAudio but XMMS included and init!) !
    Before I used to use VectorLinux, but there haven’t really been any updates for around 5 years now, which unfortunately is a dealbreaker for web surfing.

    I intend to use antiX as my daily driver OS and it seems to check all the boxes, except for one thing – I use my PC for multimedia quite heavily, and playing high-bitrate video files doesn’t really work. SMplayer keeps buffering all the time after playing a couple of seconds even though I have already increased its buffer. I should add that I have installed Xfce4 and am currently using it.

    I’ve got two separate internal hard drives; one for the system (swap, root, and home) and another, which holds said high-bitrate video files, just mounted using the file manager-provided mountpoint (for now). Also when opening a folder on said second hard drive or when copying files, the performance is incredibly meek (around 8MiB/s). That hard drive is semi-server-grade and hasn’t seen a lot of use; before I used to get up to around 190MiB/s!

    Then I noticed that the HDD LED is rapidly blinking all the time, even when the system is idle. Yet lsof shows only mplayer using the video file from the second hard drive’s file system while playing, nothing else.
    First I suspected conky’s hard disk activity monitor, but terminating conky made no difference. Terminating the SMART daemon made no difference, either.

    What else could be polling the hard drive all the time then???

    Any help would be greatly appreciated!

    • This topic was modified 3 days, 17 hours ago by scififry. Reason: Added [SOLVED] to the topic title
    #71630
    Member
    Xecure
    Helpful
    Up
    1
    ::

    Please share your system information
    inxi -Fxz
    so we can have a better idea of your antiX version, kernel configuration and system information.

    You can install iotop (sudo apt install iotop) and run it to see what processes are constantly reading/writing to your disk. I suspect it may be a log or some other related process
    sudo iotop -o

    antiX Live system enthusiast.
    General Live Boot Parameters for antiX.

    #71638
    Member
    scififry
    Helpful
    Up
    0
    ::

    Thank you for your reply!

    Until now I only knew uname; inxi is very useful.

    
    inxi -Fxz
    System:
      Kernel: 5.10.57-antix.1-amd64-smp x86_64 bits: 64 compiler: gcc v: 10.2.1 
      Desktop: Xfce 4.16.0 Distro: antiX-21_x64-full Grup Yorum 31 October 2021 
      base: Debian GNU/Linux 11 (bullseye) 
    Machine:
      Type: Desktop Mobo: Gigabyte model: EP43-DS3L v: x.x serial: <filter> 
      BIOS: Award v: F4 date: 06/19/2008 
    CPU:
      Info: Dual Core model: Intel Core2 Duo E8400 bits: 64 type: MCP 
      arch: Penryn rev: 6 cache: L2: 6 MiB 
      flags: lm nx pae sse sse2 sse3 sse4_1 ssse3 vmx bogomips: 14401 
      Speed: 2604 MHz min/max: 2400/2800 MHz Core speeds (MHz): 1: 2604 2: 2787 
    Graphics:
      Device-1: NVIDIA G72 [GeForce 7300 LE] vendor: ASUSTeK driver: nouveau 
      v: kernel bus-ID: 01:00.0 
      Display: x11 server: X.Org 1.20.11 driver: loaded: nouveau 
      unloaded: fbdev,modesetting,vesa resolution: 1280x1024~75Hz 
      OpenGL: renderer: NV46 v: 2.1 Mesa 20.3.5 direct render: Yes 
    Audio:
      Device-1: Philips s SAA7134/SAA7135HL Video Broadcast Decoder 
      vendor: Pinnacle Systems PCTV 300i DVB-T + PAL driver: saa7134 v: 0, 2, 17 
      bus-ID: 05:00.0 
      Device-2: VIA ICE1712 [Envy24] PCI Multi-Channel I/O driver: snd_ice1712 
      v: kernel bus-ID: 05:01.0 
      Sound Server-1: ALSA v: k5.10.57-antix.1-amd64-smp running: yes 
    Network:
      Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
      vendor: Gigabyte driver: r8169 v: kernel port: b000 bus-ID: 04:00.0 
      IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
    Drives:
      Local Storage: total: 5.46 TiB used: 756.92 GiB (13.5%) 
      ID-1: /dev/sda vendor: Seagate model: ST1000NM0011 size: 931.51 GiB 
      ID-2: /dev/sdb vendor: Seagate model: ST1000VX000-1ES162 size: 931.51 GiB 
      ID-3: /dev/sdc vendor: Seagate model: ST4000VX007-2DT166 size: 3.64 TiB 
    Partition:
      ID-1: / size: 24.82 GiB used: 5.1 GiB (20.6%) fs: ext4 dev: /dev/sda2 
      ID-2: /home size: 875.91 GiB used: 751.81 GiB (85.8%) fs: ext4 
      dev: /dev/sda3 
    Swap:
      ID-1: swap-1 type: partition size: 4.9 GiB used: 0 KiB (0.0%) 
      dev: /dev/sda1 
    Sensors:
      System Temperatures: cpu: 44.0 C mobo: N/A gpu: nouveau temp: 51.0 C 
      Fan Speeds (RPM): N/A 
    Info:
      Processes: 157 Uptime: 7m Memory: 3.84 GiB used: 1017.3 MiB (25.9%) 
      Init: SysVinit runlevel: 5 Compilers: gcc: 10.2.1 Packages: 1832 
      Shell: Bash v: 5.1.4 inxi: 3.3.06

    /dev/sda is the system disk, /dev/sdc is the data disk, and /dev/sdb is my old system disk which is not currently used; I left it connected for now to copy off some data.

    iotop -o while SMplayer is “playing” a video file (for smooth playback it’d need about 10MiB/s) :

    
      Total DISK READ:  256.75 K/s ⣸⣄⣀⣄⣠⣇⣠⠀⠀⠀⣿⡄⠀ |   Total DISK WRITE:    0.00 B/s ⢸⡆⣀⠀⢸⣰⢀⣰⠀⢀⠀⣆⠀
    Current DISK READ:  128.38 K/s ⣸⣄⣀⣄⣠⣇⣠⠀⠀⢀⣿⣤⠀ | Current DISK WRITE:    0.00 B/s ⠀⣾⠀⡀⢰⢰⠀⠀⢀⡇⠀⡆⠀
    TID     PRIO USER      DISK READ   DISK WRITE  SWAPIN   IO       GRAPH▽        COMMAND                               
        5   be/4 root         0.00 B/s    0.00 B/s   0.00 %  80.67 % ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿  kworker/0:0+events                  ▲
     9112   be/4 scififry   128.38 K/s    0.00 B/s   0.00 %  80.42 % ⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀ ╭mpv                                 █
     9120   be/4 scififry   128.38 K/s    0.00 B/s   0.00 %  80.42 % ⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀ ╰mpv                                 █
     8476   be/4 root         0.00 B/s    0.00 B/s   0.00 %   0.11 % ⡀⢀⢀⡇⠀⡇⠀⢸⢀⣀⠀⢀⠀  kworker/u8:3+events_freezable_power_█
     5311   be/4 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⢀⠀⠀⣀⠀⣀⣀⠀⣸⡀⡇⢀  kworker/u8:2-events_unbound         █
     9048   be/4 scififry     0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀ ╭mpv                                 █
     9058   be/4 scififry     0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀ ╰mpv                                 █
      120   be/4 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⡇⡀⢀⠀⠀⠀⠀⠀⠀⠀⠀⡀  kworker/u8:5-scsi_tmf_1             █
      226   be/3 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⢀⠀⠀⡀⠀⢀⠀⠀⢀⠀⠀⡀⠀  jbd2/sda2-8                         █
     1259   be/3 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀  jbd2/sda3-8                         █

    iotop -o while idle; firefox (which I’m using now to post this), SMplayer, a ROXTerm, and Leafpad left open:

    
      Total DISK READ:    0.00 B/s ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ |   Total DISK WRITE:    0.00 B/s ⢀⡀⠀⢀⣠⣀⣸⠀⡀⢀⣀⢀⡀
    Current DISK READ:    0.00 B/s ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | Current DISK WRITE:    0.00 B/s ⠀⡀⠀⢀⡀⠀⢸⠀⠀⢀⠀⢀⢀
    TID     PRIO USER      DISK READ   DISK WRITE  SWAPIN   IO       GRAPH▽        COMMAND                               
        5   be/4 root         0.00 B/s    0.00 B/s   0.00 %  81.89 % ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿  kworker/0:0+events                  ▲
    10009   be/4 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⠀⡀⢸⡀⢀⠀⠀⣀⢸⠀⢸⠀  kworker/u8:0-events_unbound         █
     8476   be/4 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⢀⣀⠀⠀⠀⠀⣀⣸⠀⣀⢀⣀⡀  kworker/u8:3-events_unbound         █
     5311   be/4 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⢸⠀⣀⢀⢸⠀⠀⠀⠀⠀⠀⠀  kworker/u8:2+events_freezable_power_█
      226   be/3 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⡀⠀⠀⡀⠀⢀⠀⠀⢀⠀⠀⢀  jbd2/sda2-8                         █
     1259   be/3 root         0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⢀⠀  jbd2/sda3-8                         █
     3105   be/4 scififry     0.00 B/s    0.00 B/s   0.00 %   0.00 % ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀  firefox-esr                         █

    So it is a kernel-related issue?

    • This reply was modified 4 days, 7 hours ago by scififry. Reason: Edited for code citation field (I presumed the old [code][/code] would've worked.)
    • This reply was modified 4 days, 6 hours ago by scififry.
    • This reply was modified 4 days, 6 hours ago by scififry.
    #71643
    Member
    skidoo
    Helpful
    Up
    0
    ::

    firefox, by default, performs a write to disk to update its “session data” every 15 seconds.
    Discussed previously in this forum, you can search your ff prefs for session and assign a longer value for the writeback interval. Toward entirely eliminating the ff writeback operations, you can also specify a ramdisk cache location.

    A few of my hard drives do perform frequent/incessant “polling” unless I use the
    https://man7.org/linux/man-pages/man8/hdparm.8.html
    command to instruct the drive to idle or to enter a lower power state after xx seconds of inactivity.

    #71661
    Member
    scififry
    Helpful
    Up
    0
    ::

    Thank you for your reply, but your solution would not solve my problem – I need the hard drives to be in their fully powered states in order to get a good performance out of them!
    The HDD activity LED is lit for about 70% of the time on average, flashing in a “beat” of sorts all the time, as if something were reading lots of file headers or something.
    This exact same hard drive (/dev/sdc above) with the same partitions (ext4) and data worked perfectly well with the old VectorLinux install and the automatic power management worked too – when accessing its file system when it was not used for a couple of minutes or not mounted before, it took a second and you could hear the hard drive spinning up.

    I’m aware that firefox accesses the filesystem very frequently while running, but not this heavily (On most systems the HDD LED used to flash so shortly it was barely visible). Of course every program accessing a file system contributes to increased access times, especially so on mechanical hard drives, but the data SMplayer needs to access is stored on a different physical hard drive altogether!

    #71664
    Forum Admin
    anticapitalista
    Helpful
    Up
    1
    ::

    Try the 4.9 kernel

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #71666
    Member
    PPC
    Helpful
    Up
    0
    ::

    Also, beside the possible Kernel problems- your machine’s hardware should not have any problems decoding video files, but I found that even old 32bits computers are able to play HD video files using xine video player – not an ideal choice, I know, but you can test it’s performance (you can install it from the terminal with “sudo apt install xine-ui”- it will take care of all dependencies)

    P.

    #71669
    Member
    wildstar84
    Helpful
    Up
    0
    ::

    This may only be indirectly related to your issue, but may help:

    I created a script in usr_local_bin called “set_sata_performance.sh”:

    #!/bin/bash
    
     # Set SATA channel: 
     for foo in /sys/class/scsi_host/host*/link_power_management_policy;
     do echo $1 > $foo;
     done

    On system startup, I invoke it as: set_sata_performance.sh med_power_with_dipm

    This will reduce power, battery, temperature, etc. but the tradeoff is that autoscanning is disabled.
    This also seems to need to be invoked again when resuming from suspend or hibernate. It reduced the temperature coming from my disk thermal sensor by about 10 degrees.

    Then, in your script that mounts / unmounts your disk, to get it scanned manually, add the command:

    echo "- - -" >/sys/class/scsi_host/host4/scan

    Note: You’ll have to change “host4” to the right one for that disk.

    SEE ALSO: https://wiki.archlinux.org/index.php/Power_management#Processors_with_HWP_.28Hardware_P-state.29_support
    and https://www.phoronix.com/scan.php?page=news_item&px=Linux-4.15-libata-power

    #71699
    Member
    scififry
    Helpful
    Up
    0
    ::

    Thanks for your replies, everyone! 🙂

    Try the 4.9 kernel

    And I didn’t realize that the 4.9 kernel was already installed and directly bootable from GRUB’s advanced options menu >.< (I’m still used to lilo)
    Anyhow, this solved the problem!!! Thank you!!! Overall system performance is much better and the flashing of the HDD activity LED has come down to a very reasonable level. iotop -o now shows very little usage by kworker.

    Also, beside the possible Kernel problems- your machine’s hardware should not have any problems decoding video files, but I found that even old 32bits computers are able to play HD video files using xine video player – not an ideal choice, I know, but you can test it’s performance (you can install it from the terminal with “sudo apt install xine-ui”- it will take care of all dependencies)

    P.

    I already installed xine and had the same issue as with SMplayer, but thanks for your suggestion!
    On many distros from the last couple of years the xine packages had dependency/build issues and just didn’t work; it’s very nice to see a distro with xine working again! For using DVD menus, xine is IMO pretty much the best video player on Linux. I know it’s quite efficient since it’s the video player I used on my first own Linux system 11 years ago: A 350MHz PII with 320MiB of RAM with an old ATI graphics card, and it was just fast enough to play DVDs.

    Also, thank you for sharing your script, wildstar84!
    Unfortunately I’m not well-versed with scripts and where to invoke them if not told exactly (in the init file I guess?). I’m still learning how to use Linux on a professional level and would like to learn even more, but I’ve got lots of other stuff to do and basically just need a system that works well and doesn’t annoy me.

    Could this kworker issue be considered as a bug in the 5.10.57-antix.1-amd64-smp kernel build and should I do anything like filing a bug report or is this too specific of an issue?

    • This reply was modified 3 days, 18 hours ago by scififry. Reason: Typo fixed
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.