Netgear 7800 CPUGOV Command

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2  Next
Author Message
hifiboy
DD-WRT Novice


Joined: 18 Nov 2021
Posts: 45

PostPosted: Thu Nov 18, 2021 22:18    Post subject: Netgear 7800 CPUGOV Command Reply with quote
Hello, I tried execuitng a command on r44719 bult:

for CPUGOV in sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;do[-f$CPUGOV]//continue;echo-n ondemand>$CPUGOV;done

However, it gives me a message sh: eval: line 1: syntax error: unexpected word (expecting "do")

Am i doing something wrong?
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Thu Nov 18, 2021 22:46    Post subject: Reply with quote
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=328628

Quote:
for CPUGOV in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do [ -f $CPUGOV ] || continue;
echo -n ondemand > $CPUGOV;
done

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614

Also, please consider upgrading from the build in the router database. It is not the most recent, and the router database is not updated.

https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2021/11-18-2021-r47656/netgear-r7800/

#pleasedontdoatldr

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
hifiboy
DD-WRT Novice


Joined: 18 Nov 2021
Posts: 45

PostPosted: Fri Nov 19, 2021 15:11    Post subject: Reply with quote
Does running at all the time at full clock speed would not reduce the life of the router?.

When I read the PDF document from here: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614

It stated that r44719 is one of the favourate built (perhaps is more stable)?. What would be the major advantage of upgrading to the beta 18.11.21?
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6446
Location: UK, London, just across the river..

PostPosted: Fri Nov 19, 2021 15:23    Post subject: Reply with quote
hifiboy wrote:
Does running at all the time at full clock speed would not reduce the life of the router?.


nope, really ...

i run it for a long time like that no problem its been build to sustain high speeds and temp...

than moved to speed step again... you can add those lines to start up script

for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do [ -f $CPUFREQ ] || continue; echo -n ondemand > $CPUFREQ; done
echo 35 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

hifiboy wrote:
When I read the PDF document from here: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614

It stated that r44719 is one of the favourate built (perhaps is more stable)?. What would be the major advantage of upgrading to the beta 18.11.21?


44719 is old and has security holes...always good to read new builds threads, as well SVN line... and run last builds...usually the last builds have fixes and ect.

There is not such an animal as a 'stable build'....its stable for one, but not stable for someone else, it depends what kind of set up you run on your router...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913


Last edited by Alozaros on Fri Nov 19, 2021 17:44; edited 1 time in total
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Fri Nov 19, 2021 15:27    Post subject: Reply with quote
@Alozaros: check your logs. I quoted the correct script and linked the thread. Trying to one-line that will likely not work as the OP suggests.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Fri Nov 19, 2021 16:24    Post subject: Reply with quote
One line will work if you do not make typos.
Typos are hard to spot in one line.

If you just copy paste it it will work but when typing there is a difference between // and ||

The rule "must" be used together with:
echo 35 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

Otherwise the router is really slow.

Does it harm to run at full speed?
I do not think so the router runs really cool even at full speed.

Does it save power?
In theory yes, in practice minimal.

Do I use it?
Yes, because I can and it looks really cool (as if I know what I am doing) Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3002
Location: Germany

PostPosted: Fri Nov 19, 2021 17:11    Post subject: Reply with quote
hifiboy wrote:
Does running at all the time at full clock speed would not reduce the life of the router?.


No, the CPU governor and ondemand scaling is primarily a power saving function.
However, the differences in this CPU are marginal, only a few milliwatts difference whether the CPU runs at 800 or 1700Mhz.

CPU's are also designed in principle to run at full clock speed and throttling is unnecessary.

Besides, this is a smartphone CPU, the cores are the same as in the Snapdragon S4 pro.
With the difference that they cannot be cooled properly in a smartphone - hence the thermal throttling Smile

In a router like the R7800, the CPU has a massive 5mm thick metal plate as a heatsink.
Even under full load for 30 minutes, the CPU rarely reaches 65-70°C.

therefore scaling and thermal throttling is absolutely not necessary and superfluous in this router.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6446
Location: UK, London, just across the river..

PostPosted: Fri Nov 19, 2021 17:42    Post subject: Reply with quote
in my case all works ok...one line...
as ho1Aetoo noted you must be sure there is no typo
as well as egc announced you'd need this extra line too

echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Fri Nov 19, 2021 18:18    Post subject: Reply with quote
Yes, there was a typo in the OP. That is why I quoted the thread with the correct text. The other method will work if there are no typos. Sorry for the confusion, if any. This is how I have it entered in my R7800:
Code:
for CPUGOV in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do [ -f $CPUGOV ] || continue;
echo -n ondemand > $CPUGOV;
done
echo 35 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

and that is what I go by. It doesn't use any more or any less nvram space, lol.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
funmonkey100
DD-WRT Novice


Joined: 15 Aug 2021
Posts: 2

PostPosted: Sun Nov 21, 2021 12:59    Post subject: Reply with quote
I am having the same problem, I have no idea what is missing.

Router Model-Netgear R7800

Firmware Version-DD-WRT v3.0-r47282 std (08/30/21)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Sun Nov 21, 2021 13:07    Post subject: Reply with quote
You cannot use the command box to execute anything more than a basic command.

Just look at the R7800 guide:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614

To give you the clue from page 7 from said guide:
Quote:
All the commands have to be run from Administration/Commands, Save Startup

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Sun Nov 21, 2021 13:08    Post subject: Reply with quote
You have to save that as a startup script; it may or may not work via the web shell due to syntax or some other anomaly. This is meant to be saved as a startup script, not run on the fly.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3002
Location: Germany

PostPosted: Sun Nov 21, 2021 13:13    Post subject: Reply with quote
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1184256#1184256

ho1Aetoo wrote:
Quote:
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do [ -f $CPUFREQ ] || continue; echo -n performance > $CPUFREQ; done


... gives me some stranges syntax erros when i hit "execute command"

Code:
sh: eval: line 1: syntax error: unexpected ";"


Keep it easy...

Code:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor


works without the shitty syntax errors ..


Razz
simply replace performance with ondemand


Code:
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
funmonkey100
DD-WRT Novice


Joined: 15 Aug 2021
Posts: 2

PostPosted: Sun Nov 21, 2021 13:29    Post subject: Reply with quote
egc wrote:
You cannot use the command box to execute anything more than a basic command.

Just look at the R7800 guide:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614

To give you the clue from page 7 from said guide:
Quote:
All the commands have to be run from Administration/Commands, Save Startup


That's perfect I wasn't sure if I could test the code before saving as start-up. That's a great pdf you have I keep coming back to it for updates. Thank You
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3002
Location: Germany

PostPosted: Sun Nov 21, 2021 13:42    Post subject: Reply with quote
if you use simple and straightforward code then you can also test it beforehand and run it in webIF

code that looks complicated but does not work in WebIF has no advantages

Code:
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 35 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor


this also works in webif and does the same thing

Wink
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum