Jump to content
XPEnology Community

CPU Frequency scaling for DS918+


Trauma

Recommended Posts

Hi All!

 

i read all comments, and then try to solve my same problem, on my server XPEnology DS918+ (Asrock H110M ITX Mobo, i3-6100 CPU, 2 cores+ 2HT, 16GB DDR4 with 6.2.3-25426, today the last update) high cpu freq running. I do anything, but my cpu runs at highest freqency, on 3700. How can i do that  process?  Thanks!

Edited by Rick4
mistyping
Link to comment
Share on other sites

Hello!

I've tested performance of my J4105, DS918+, 1.04b. Without script.

Geeknech 5 + docker.

docker run --rm davidsarkany/geekbench && docker rmi davidsarkany/geekbench
My result is https://browser.geekbench.com/v5/cpu/4246087

 It corresponds to Turbo clock 2500MHz, but DSM reports 1501MHz.

 

1500MHz - base.

1501MHz - active burst.

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
On 10/19/2020 at 7:52 AM, Demitsuri said:

Hello!

I've tested performance of my J4105, DS918+, 1.04b. Without script.

Geeknech 5 + docker.

docker run --rm davidsarkany/geekbench && docker rmi davidsarkany/geekbench
My result is https://browser.geekbench.com/v5/cpu/4246087

 It corresponds to Turbo clock 2500MHz, but DSM reports 1501MHz.

 

1500MHz - base.

1501MHz - active burst.

 

 

Older kernels don't always report turbo speeds properly. BSD works in some of the same way.

 

You sometimes see at least 3 frequencies:

Base: ex 800mhz

Peak: ex 2500mhz

Turbo: ex 2501 

 

You could have many frequencies between 800 and 2500mhz, but 2501 would signify that the cpu is in turbo mode.

Link to comment
Share on other sites

I am unable to get this to work on a 10th gen i7-10700. I get the task to run but it only puts the cpu at full turbo speed.

 

With these newer cpus, there are 4-5 different settings in bios regarding speedstep, speedshift etc. Do I need to disable anything?

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

thank you for such scripts it runs almost fine on my configuration (I3-4160, 8GB RAM, DSM 6.2.3 u3).

My CPU supports 3 governors - userspace, performance, powersafe.

 

Anyway I also realized, that for some unknown reason, the governor is time to time (usually at night when there is no load (?)) switched from "userspace" updated by the script to "performance" and then the running main function fails on the error already described in this forum (/usr/local/bin/scaler.sh: line 57: echo: write error: Invalid argument):

echo "$minfreq" > /sys/devices/system/cpu/cpu"${i}"/cpufreq/scaling_setspeed

Assuming that when the governor is set to different state from userspace it is not possible to externally update the frequency.

 

So in order to avoid the problem I just copied the the part of code checking and updating the governor in to the beginning of the main function:

# Set correct cpufreq governor to allow user defined frequency scaling
governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
if [ "$governor" != "userspace" ]; then
  for i in $(seq 0 "${cpucorecount}")
    do
      echo userspace > /sys/devices/system/cpu/cpu"${i}"/cpufreq/scaling_governor
  done
fi

 

So far I have no idea what and why the governor gets modified and especially to the "performance".

 

But at least such small modification prevents the script from failing.

Link to comment
Share on other sites

  • 2 weeks later...
On 10/19/2020 at 7:52 AM, Demitsuri said:

Hello!

I've tested performance of my J4105, DS918+, 1.04b. Without script.

Geeknech 5 + docker.

docker run --rm davidsarkany/geekbench && docker rmi davidsarkany/geekbench
My result is https://browser.geekbench.com/v5/cpu/4246087

 It corresponds to Turbo clock 2500MHz, but DSM reports 1501MHz.

 

1500MHz - base.

1501MHz - active burst.

 

 

 That's not right. Your score is much lower than many other users with Intel J4105 ( running Windows 😞 ) https://browser.geekbench.com/v4/cpu/search?q=J4105

Especially the single thread benchmark. This may show the Turbo/Boost isn't actually working. 

 

Link to comment
Share on other sites

В 10.02.2021 в 04:40, wenlez сказал:

 That's not right. Your score is much lower than many other users with Intel J4105 ( running Windows 😞 ) https://browser.geekbench.com/v4/cpu/search?q=J4105

Especially the single thread benchmark. This may show the Turbo/Boost isn't actually working. 

 

Lower, yes.

Torrent was active, about 10-12mbyte/s upload.

3-4 docker containers. 

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

I use an ASROCK j3355B-ITX board. I migrate from a HP Microserver N54L to this DIY solution. I set up the system very fine with Jun 104b / 918+ including patching the synoboot (vid/pid/sn/mac, extra.lzma...). Everything runs smooth EXCEPT  throttling the CPU. It always runs with 2.000 mhz which seems to be the basement frequency.

I used different solutions including this script here but iam stucked with an all time 2.000 MHZ frequency OR 1.800 Mhz.

It is a must have to activate intel speedstep in the bios, otherwise everything that checks the available frequencies fail.

Also C state is set to C1. other settings seems to not change anything concerning the scaling (C1E, vt-d...).

 

Without any script started:

dmidecode -t processor | grep Speed
        Max Speed: 2500 MHz
        Current Speed: 2000 MHz 

When i start the script via the task scheduler it seems like nothing is changed. When i start the script via SSH and parameters: the frequency shifts to 1.800 MHz but is still not scaling. It doesn't matter what settings i use for scalingminfreq or lowload, highload... The output is as following:

 

cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
2000000 120442
1900000 0
1800000 4622
1700000 0
1600000 0
1500000 0
1400000 0
1300000 0
1200000 0
1100000 0
1000000 0
900000 0
800000 0

 

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies show me all available frequencies starting from 800000.

 

As I don't need hardware transcoding i switched back to jun 1.03b and DS3617xs. Here i can change the governor - in my case conservative - and the scaling works perfectly.

Therefore i used the already mentioned script by @sszpila from here as a user defined task in DSM that runs every 30 minutes:

#!/bin/sh
for c in $(ls -d /sys/devices/system/cpu/cpu[0-9]*);
do if ! grep -q 'conservative' $c/cpufreq/scaling_governor ;
   then echo conservative >$c/cpufreq/scaling_governor ;
fi
done

 

To my surprise, the power consumption is not changed (stays with 17W in idle (2 HDD attached). On my HP N54L with 5 HDD the power consumption shifted from 45W to 41W, idle/HDD spin down from 27W to 25W.

Anyway i will stay on 3617 until a shift is a must have (maybe because of DSM 7.0, who knows...)

 

Edited by suschmania
  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

I've tried it on my XPE box (i3-4130, Jun's loader 1.04b, DS918+, DSM 6.2.3-25426 U3) and got a weird result: 2 cores always run at 800MHz, 2 cores always run at 3400MHz.

Update:

# grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }'
1 <= Problem here.

 

i3-4130 have 2 cores and 4 threads => need modify scripts like this:

# grep cores /proc/cpuinfo | sort -u | awk '{ print $4 + 1}'

Edited by DHD
Link to comment
Share on other sites

On 8/14/2021 at 6:07 AM, DHD said:

I've tried it on my XPE box (i3-4130, Jun's loader 1.04b, DS918+, DSM 6.2.3-25426 U3) and got a weird result: 2 cores always run at 800MHz, 2 cores always run at 3400MHz.

Update:

# grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }'
1 <= Problem here.

 

i3-4130 have 2 cores and 4 threads => need modify scripts like this:

# grep cores /proc/cpuinfo | sort -u | awk '{ print $4 + 1}'

This is strange because cpu count start at zero, not one. Does this really fix you're problem ?

Link to comment
Share on other sites

  • 3 weeks later...
  • 5 months later...

what is the meaning of lowload "integer between 000 and 999"? 050 = load average : 0.50

 

does it mean that processor load lower than 50% considered as lowload?

why the integer not 000 and 100? why 999?

why your example highload=200? the comment said that 85 is 85% CPU load. what the meaning of 200?

I create my own lowload=050 highload=200 midload=100

 

Edit:

I am understand 

 

I was created lowload=100 midload=200 highload=300 because I have 4 cores. G5420

Edited by Rayqusa
Link to comment
Share on other sites

  • 1 month later...
On 4/12/2022 at 1:24 AM, phone guy said:

Does this script work on RP and DSM 7.1 ???

 

I have 2 boxes, both other brand nas boxes, one running a J3355 and the other is a Pentium N3710 ... so there is no bios to set anything in.

It should, it's not related to the OS but to the kernel configuration. It's a pretty standard kernel feature, and it won't hurt to try.

Link to comment
Share on other sites

  • 2 weeks later...
On 4/23/2022 at 12:32 AM, ngsupb said:

unfortunately doesn't work anymore on 7.1

cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or director

 

It was a great script! :( 

 

 

What syno model do you use ?

 

What is this command output : cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

 

Thx.

Link to comment
Share on other sites

18 hours ago, Trauma said:

 

What syno model do you use ?

 

What is this command output : cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

 

Thx.

it's DS3622xs+ DMS 7.1 was built with RedPill Tinycore loader. I had DS3617xs+ build same way,  it worked fine

 

interesting but /sys/devices/system/cpu/cpu0/cpufreq folder doesn't exist at all

bash-4.4# ls -l /sys/devices/system/cpu/cpu0/
total 0
drwxr-xr-x 7 root root    0 Apr 26 17:51 cache
drwxr-xr-x 6 root root    0 Apr 26 17:51 cpuidle
-r-------- 1 root root 4096 Apr 26 17:51 crash_notes
-r-------- 1 root root 4096 Apr 26 17:51 crash_notes_size
lrwxrwxrwx 1 root root    0 Apr 26 17:51 driver -> ../../../../bus/cpu/drivers/processor
lrwxrwxrwx 1 root root    0 Apr 26 17:51 firmware_node -> ../../../LNXSYSTM:00/LNXCPU:00
drwxr-xr-x 2 root root    0 Apr 26 17:51 power
lrwxrwxrwx 1 root root    0 Apr 26 17:51 subsystem -> ../../../../bus/cpu
drwxr-xr-x 2 root root    0 Apr 26 17:51 thermal_throttle
drwxr-xr-x 2 root root    0 Apr 26 17:51 topology
-rw-r--r-- 1 root root 4096 Apr 26 17:51 uevent

 

Could someone check DMS 7.1 if /sys/devices/system/cpu/cpu0/cpufreq exists?

Link to comment
Share on other sites

On 4/27/2022 at 10:28 PM, Trauma said:

Does this give something ?


ls /lib/modules/ | grep "cpufreq"

 

 

ls /lib/modules/ | grep "cpufreq"
acpi-cpufreq.ko
cpufreq_performance.ko
cpufreq_powersave.ko
cpufreq_stats.ko
 

yes, it's there. Is it possible I could have disabled it in bios? I recall there was an option to power save for cpu in bios

Link to comment
Share on other sites

  • 2 weeks later...
On 5/4/2022 at 9:33 AM, ngsupb said:

 

ls /lib/modules/ | grep "cpufreq"
acpi-cpufreq.ko
cpufreq_performance.ko
cpufreq_powersave.ko
cpufreq_stats.ko
 

yes, it's there. Is it possible I could have disabled it in bios? I recall there was an option to power save for cpu in bios

Did you manage to get it working as i have the same on my system, i'll double check in the morning but i'm sure all states are enabled.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...