# Performance Issue of RL9 on Raspberry Pi 4

**URL:** <https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206>\
**Category:** Rocky Linux Help & Support\
**Created:** [September 12, 2022, 5:43am UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206 "2022-09-12T05:43:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jachaussloef](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jachaussloef](https://forums.rockylinux.org/u/jachaussloef)\
**Post date:** [September 12, 2022, 5:43am UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/1 "2022-09-12T05:43:31Z")

</div>

neofetch says the CPU is working @ 1.5 GHz, but the performance is far from normal.  
When using 7z 22.01’s performance test it reports that the CPU frequency is only 0.6 GHz. I’ve tried to overclock it to 2.2 GHz by adding config.txt, but still only neofetch reports this frequency while CPU still working on 0.6 when doing 7z performance test.  
Is it working on powersave mode? If so, how can we change it to schedutil🤔

```auto
          __wgliliiligw_, root@raspberry-pi-4-rocky
       _williiiiiiliilililw, -------------------------
     _%iiiiiilililiiiiiiiiiii_ OS: Rocky Linux 9.0 (Blue Onyx) aarch64
   .Qliiiililiiiiiiililililiilm. Host: Raspberry Pi 4 Model B Rev 1.1
  _iiiiiliiiiiililiiiiiiiiiiliil, Kernel: 5.15.55-v8.1.el9.altarch
 .lililiiilililiiiilililililiiiii, Uptime: 36 mins
_liiiiiiliiiiiiiliiiiiF{iiiiiilili, Packages: 735 (rpm)
jliililiiilililiiili@` ~ililiiiiiL Shell: bash 5.1.8
iiiliiiiliiiiiiili>` ~liililii Resolution: 2560x1440
liliiiliiilililii` -9liiiil Theme: Adwaita [GTK3]
iiiiiliiliiiiii~ "4lili Icons: Adwaita [GTK3]
4ililiiiiilil~| -w, )4lf Terminal: /dev/pts/0
-liiiiililiF' _liig, )' CPU: BCM2835 (4) @ 1.500GHz
 )iiiliii@` _QIililig, Memory: 213MiB / 1849MiB
  )iiii>` .Qliliiiililw
   )<>~ .mliiiiiliiiiiil,
            _gllilililiililii~
           giliiiiiiiiiiiiT`
          -^~$ililili@~~'

```

```auto
7-Zip (z) 22.01 (arm64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15
 64-bit arm_v:8 locale=zh_CN.UTF-8 Threads:4, ASM

Compiler: 9.2.1 20191025 GCC 9.2.1
Linux : 5.15.55-v8.1.el9.altarch : #1 SMP PREEMPT Tue Jul 26 04:16:30 UTC 2022 : aarch64
PageSize:4KB hwcap:887:CRC32:ASIMD
LE 

1T CPU Freq (MHz): 597 598 596 597 596 596 597
2T CPU Freq (MHz): 200% 597 199% 592  

RAM size: 1849 MB, # CPU hardware threads: 4
RAM usage: 889 MB, # Benchmark threads: 4

                       Compressing | Decompressing
Dict Speed Usage R/U Rating | Speed Usage R/U Rating
         KiB/s % MIPS MIPS | KiB/s % MIPS MIPS

22: 2361 306 750 2297 | 47329 385 1049 4038
23: 2314 322 733 2358 | 46794 385 1052 4049
24: 2240 324 744 2409 | 46123 386 1047 4048
25: 2170 329 753 2478 | 44745 384 1037 3982
---------------------------------- | ------------------------------
Avr: 2271 320 745 2386 | 46247 385 1046 4029
Tot: 353 896 3207

```

---

<div class="post-metadata">

**Author:** ![skip77](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@skip77](https://forums.rockylinux.org/u/skip77)\
**Post date:** [September 12, 2022, 5:38pm UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/2 "2022-09-12T17:38:05Z")

</div>

Hi! Generally speaking, the RPi’s clock speed is a function of temperature. The cores will automatically scale down as temperature goes up, to save themselves from frying. More details here: [How Hot Is Too Hot for Raspberry Pi? - Blog - Raspberry Pi - element14 Community](https://community.element14.com/products/raspberry-pi/b/blog/posts/how-hot-is-too-hot-for-raspberry-pi)

My first question would be: What kind of cooling parts do you have on your device? I use passive heatsinks over some of the key chips myself, but an active fan is also an option. If you don’t have any, the processor is likely to get really hot, really fast.

Here’s a little handy script for grabbing the temperature of your pi - just save this to something like “rpi\_temp.sh” and run it when you want your values:

```auto
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(bc <<< "${cpu} / 1000") C ($(bc <<< "${cpu} / 1000 * 1.8 + 32") F)"

```

Check out your temps as you run the tests - I think anything above 75-80 C and throttling will start.

Thanks, hope this helps. I’ll fire up my own device to test later as well!  
-Skip

---

<div class="post-metadata">

**Author:** ![jachaussloef](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jachaussloef](https://forums.rockylinux.org/u/jachaussloef)\
**Post date:** [September 13, 2022, 3:58am UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/3 "2022-09-13T03:58:37Z")

</div>

![O1CN015UsuJh1Jaef9sGOGV_!!2145451045](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/2/2f86bd5d82bc21ad945e848df929813da6137399.jpeg)  
I’m using this overkiller so temperature shouldn’t be a problem😅

---

<div class="post-metadata">

**Author:** ![schroedingersdog](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/schroedingersdog/32/1519_2.png) [@schroedingersdog](https://forums.rockylinux.org/u/schroedingersdog)\
**Post date:** [September 13, 2022, 6:28am UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/4 "2022-09-13T06:28:49Z")

</div>

Hi,

perhaps (I’m guessing here!) this has rather something to do with how 7z “calculates” the CPUs frequency based upon the features it uses to perform compression. To be on the safe side, although probably a bit tedious, I’d consider running a standard Raspbian or maybe give DietPi a try and then check out what 7z reports on these OS.  
If there is no big difference, then it’s probably a 7z thing. If there _IS_ a difference in speed, then it’s a RL (or even RHEL?) thing. Which might mean that there is some kind of optimzation not available in the stack (packages, etc.) used by RL. But that’s just pure guessing as said.

Cheers, Thomas

---

<div class="post-metadata">

**Author:** ![jachaussloef](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jachaussloef](https://forums.rockylinux.org/u/jachaussloef)\
**Post date:** [September 13, 2022, 1:05pm UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/5 "2022-09-13T13:05:28Z")

</div>

Thanks for the reply. I did have other systems in the past such as Rocky Linux 8.6, Oracle Linux 8.6 (so might not be RHEL related), Ubuntu 22.04 and even an OpenWRT router system. None of them have any issues like this. But since I’ve got a spare SD card, I will try flashing RL9 again to see if the problem is gone ( if so then I’ll be more confused what caused this issue since the system is pretty much a clean one😂)

UPDATE:  
I reflashed RL9 on a spare SD card and tested 7z on the absolutely clean system and it is still the same. By the way, I discovered this issue not by using 7z benchmark, but when using a KVM virtual machine. The performance was about 1/4 to 1/3 of Rocky Linux 8.6 and Ubuntu 22.04 and then I used 7z to do some performance test and found the CPU was stuck at 0.6 GHz🤔 So I think this issue can be easily reproduced?  
My RPI 4B is 2GB RAM, version 1.1

---

<div class="post-metadata">

**Author:** ![skip77](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@skip77](https://forums.rockylinux.org/u/skip77)\
**Post date:** [September 13, 2022, 2:42pm UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/6 "2022-09-13T14:42:11Z")

</div>

Thanks for your research! I’ll investigate further and try to figure out why exactly Rocky 9 in particular has this issue. Super odd, because on the rpi, Rocky 8 and 9 actually have extremely similar kernel versions and firmware packages.

Will look into it more and let you know what I find! Anyone else want to help out, please feel free!

-Skip

---

<div class="post-metadata">

**Author:** ![skip77](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@skip77](https://forums.rockylinux.org/u/skip77)\
**Post date:** [September 13, 2022, 2:43pm UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/7 "2022-09-13T14:43:32Z")

</div>

Oh, one more thing - can you share your 7z performance test command? That way I can reproduce what you’re doing in the exact same way.

---

<div class="post-metadata">

**Author:** ![jachaussloef](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jachaussloef](https://forums.rockylinux.org/u/jachaussloef)\
**Post date:** [September 13, 2022, 3:07pm UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/8 "2022-09-13T15:07:02Z")

</div>

I downloaded 7z from  
[https://www.7-zip.org/a/7z2201-linux-arm64.tar.xz](https://www.7-zip.org/a/7z2201-linux-arm64.tar.xz)  
and the command is just

```auto
./7zz b

```

---

<div class="post-metadata">

**Author:** ![skip77](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@skip77](https://forums.rockylinux.org/u/skip77)\
**Post date:** [September 20, 2022, 3:42am UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/9 "2022-09-20T03:42:40Z")

</div>

Hey, mystery solved! We have the “powersave” profile turned on the CPU governor for whatever reason by default, which locks the speed at 600 Mhz.

Fix it like this (as root):

1. `systemctl enable cpupower; systemctl start cpupower` (To ensure the config file is present)
2. Edit `/etc/sysconfig/cpupower`, make both the lines end like this: `"frequency-set -g ondemand"` (we’re changing “powersave” to “ondemand”)
3. `systemctl restart cpupower`
4. Check the CPU governor: `cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor` . It should now say “ondemand” and not “powersave”. You can also echo values to this file to change it on-the-fly, but the changes won’t survive reboots.

This governor controls how hard the CPU works. “powersave” (our accidental default) will keep it at the minimum frequency (600 Mhz) no matter what in order to conserve energy and keep things cool. “performance” will run at the maximum clock speed (1.5 Ghz) no matter what. “ondemand” is a happy medium that will scale the rate up or down depending on workload.

Thanks for finding this, and sorry it got overlooked. You can bet we’ll have it set correctly by default in the upcoming 9.1 release. In the meantime, I hope this helps!

-Skip

---

<div class="post-metadata">

**Author:** ![jachaussloef](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jachaussloef](https://forums.rockylinux.org/u/jachaussloef)\
**Post date:** [September 20, 2022, 1:10pm UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/10 "2022-09-20T13:10:16Z")

</div>

Thanks very much! That proved my initial guess😅

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:39am UTC](https://forums.rockylinux.org/t/performance-issue-of-rl9-on-raspberry-pi-4/7206/11 "2023-08-25T03:39:41Z")

</div>

Closed on August 25, 2023, 3:39am UTC


