SSD copy speed affected by realtime-privileges ionice?

I use realtime-privileges due to audio editing and noticed that reading/writing speeds are much slower compared to another system (KDE - dolphin).
The user was added to the realtime & audio group, realtime-privileges are using ionice in rt configuration, could this be the cause?

$ cat /etc/security/limits.d/99-realtime-privileges.conf
@realtime - rtprio 98
@realtime - memlock unlimited
@realtime - nice -11
inxi -Fxxxz
System:
  Kernel: 6.1.11-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: cairo-dock wm: kwin_x11
    vt: 1 dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: Dell product: OptiPlex 7040 v: N/A
    serial: <superuser required> Chassis: type: 3 serial: <superuser required>
  Mobo: Dell model: 0HD5W2 v: A00 serial: <superuser required>
    UEFI-[Legacy]: Dell v: 1.11.1 date: 10/10/2018
CPU:
  Info: quad core model: Intel Core i7-6700 bits: 64 type: MT MCP smt: enabled
    arch: Skylake-S rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 3400 min/max: 800/3400 cores: 1: 3400 2: 3400 3: 3400
    4: 3400 5: 3400 6: 3400 7: 3400 8: 3400 bogomips: 54417
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel HD Graphics 530 vendor: Dell driver: i915 v: kernel
    arch: Gen-9 ports: active: DP-2,HDMI-A-1,HDMI-A-2 empty: DP-1,DP-3,HDMI-A-3
    bus-ID: 00:02.0 chip-ID: 8086:1912 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.7 compositor: kwin_x11 driver: X:
    loaded: intel dri: crocus gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1848 s-dpi: 96 s-size: 1016x488mm (40.00x19.21")
    s-diag: 1127mm (44.37")
  Monitor-1: DP-2 mapped: DP2 pos: top-center model: Samsung SyncMaster
    serial: <filter> res: 1360x768 hz: 60 dpi: 84 size: 410x230mm (16.14x9.06")
    diag: 470mm (18.5") modes: max: 1360x768 min: 720x400
  Monitor-2: HDMI-A-1 mapped: HDMI1 pos: bottom-r model: Acer K242HL
    serial: <filter> res: 1920x1080 hz: 60 dpi: 92
    size: 530x300mm (20.87x11.81") diag: 609mm (24") modes: max: 1920x1080
    min: 720x400
  Monitor-3: HDMI-A-2 mapped: HDMI2 pos: primary,bottom-l model: Acer K242HL
    serial: <filter> res: 1920x1080 hz: 60 dpi: 92
    size: 530x300mm (20.87x11.81") diag: 609mm (24") modes: max: 1920x1080
    min: 720x400
  API: OpenGL v: 4.6 Mesa 22.3.5 renderer: Mesa Intel HD Graphics 530 (SKL
    GT2) direct-render: Yes
Audio:
  Device-1: Focusrite-Novation Focusrite Scarlett 2i2 type: USB
    driver: snd-usb-audio bus-ID: 1-4:3 chip-ID: 1235:8016 class-ID: fe01
  Device-2: USB MIDI Interface type: USB driver: snd-usb-audio bus-ID: 1-7:5
    chip-ID: fc02:0101 class-ID: 0103
  Sound API: ALSA v: k6.1.11-1-MANJARO running: yes
  Sound Interface: sndio v: N/A running: no
  Sound Server-1: JACK v: 1.9.21 running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.65 running: no
Network:
  Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15b7 class-ID: 0200
  IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 1.39 TiB used: 239.77 GiB (16.9%)
  ID-1: /dev/sda vendor: SanDisk model: SDSSDH3 500G size: 465.76 GiB
    speed: 6.0 Gb/s type: SSD serial: <filter> rev: 20RL scheme: GPT
  ID-2: /dev/sdb vendor: Silicon Power model: SPCC Solid State Disk
    size: 953.87 GiB speed: 6.0 Gb/s type: SSD serial: <filter> rev: 916a
    scheme: GPT
Partition:
  ID-1: / size: 57.37 GiB used: 19.84 GiB (34.6%) fs: ext4 dev: /dev/sda2
  ID-2: /boot size: 511 MiB used: 149.3 MiB (29.2%) fs: vfat dev: /dev/sda1
  ID-3: /home size: 152.74 GiB used: 57.87 GiB (37.9%) fs: ext4
    dev: /dev/sda3
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 27.0 C pch: 43.5 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 247 Uptime: 6h 22m wakeups: 0 Memory: 31.11 GiB
  used: 3.5 GiB (11.3%) Init: systemd v: 252 default: graphical Compilers:
  gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman pkgs: 1448 Shell: Bash
  v: 5.1.16 running-in: konsole inxi: 3.3.25

How do you measure reading/writing speed? From where to where and what?

What happens if you use the default kernel? From my understanding, most changes from the rt version is already included since a few versions.

1 Like

Lower latency comes at the cost of lower throughput. So much for theory.
In the special case anything else can also matter.

e.g. 10GB of data takes about 20 minutes w/ RT enabled and on another system without RT and less CPU cores about 6 minutes (w/ same SSD)

Realtime always means slow, but predicable and guaranteed. All processes get the same time and the contextswitch will happen even if it means to slow everything down. This is nice if you want to receive constantly data form some hardware in a save predicable manner, but bad for performance over all.

1 Like

OK, thank you!
could this stuff can be set when starting an audio editor with a bash script instead via /etc/security/limits.d configs on start-up?

@realtime - rtprio 98
@realtime - memlock unlimited
@realtime - nice -11

ok bad idea :laughing: I have to deal with it!
maybe I can find better settings for rtprio & nice

Setting niceness level is not needed for realtime audio with jack2

How do I configure my linux system to allow JACK to use realtime scheduling? | JACK Audio Connection Kit
Contrary to a lot of misinformation on the web, there is no reason to include a line here that provides enhanced “niceness” control, which is completely irrelevant for realtime scheduling and low latency audio applications.

JACK and nice values - LinuxMusicians
There are 2 mechanisms to prioritize processes relative to each other: ‘rtprio’ and ‘nice’. ‘rtprio’ is ‘strong’, ‘nice’ is ‘softer’. If allowed, Jack will use ‘rtprio’, and in that case it does not need ‘nice’ anymore.

Using suggested command on my system with usual broadcast workflow shows that nice level for JACK packages is 0

$ ps -lu $USER
F S   UID     PID    PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD

0 S  1000  157402    1125  0  80   0 - 227951 do_sys ?       00:00:01 qjackctl
0 S  1000  157433       1  2  80   0 - 30262 hrtime ?        00:00:08 alsa_out
0 S  1000  157445    1125  1  80   0 - 94024 do_sys ?        00:00:06 patchage
0 S  1000  158000    1125  0  80   0 -  1875 do_wai ?        00:00:00 idjcstart
0 S  1000  158002  158000  3  80   0 - 103484 hrtime ?       00:00:01 jack-rack
0 S  1000  158003  158000 11  80   0 - 403993 do_sys ?       00:00:06 idjc
1 S  1000  158029  158003  5  80   0 - 295073 pipe_r ?       00:00:03 idjc

JACK log shows rtprio is in use when JACK is started

Fri Feb 17 16:23:02 2023: Starting jack server...
Fri Feb 17 16:23:02 2023: JACK server starting in realtime mode with priority 98

rtprio level can be adjusted in settings for QjackCtl and Cadence;
or jackd options -R, --realtime and -P, --realtime-priority
or jack_control
But I don’t think that reducing rtprio will help with disk i/o issue

1 Like

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