Problem with cpuload plugin

somus1735

Member
May 25, 2018
833
0
16
Hello,
I have installed ruTorrent v3.6 with rTorrent 0.9.2/0.13.2 on NAS Synology DS412+ Cedarview CPU Intel Atom D2700 Dualcore (2C/4T) 2.13GHz x86 Processor
and have some problem with cpuload plugin - always shows 100% usage ;( , plugin graphbar is displayed good full red color and 100% on them.

The file 'cpu.dat' is creating once in user settings directory after first starting ruTorrent and have:

Code:
O:4:"rCPU":2:{s:4:"hash";s:7:"cpu.dat";s:5:"count";i:1;}
Page http://NAS_IP/rutorrent/plugins/cpuload/action.php shows:

Code:
{ "load": 100 }
Commands shows:

Code:
DiskStation> cat /proc/stat | grep -v "^cpu " | grep -c "^cpu"
4
DiskStation> uptime
19:01:15 up 5 days, 18:54, load average: 1.27, 1.32, 1.39
DiskStation> cat /proc/loadavg
1.45 1.37 1.41 2/127 26267
DiskStation>
What can I check and do or how change cpu.php file for properly display cpu usage on cpuload plugin on DS412+?

Regards,
 

somus1735

Member
May 25, 2018
833
0
16
Thanks for reply.

$processorsCount variable if I set to 2 or 4 or 8 nothing change - always show 100% usage.

Probably that load average grather than 1 is the problem:

Code:
DiskStation> uptime
19:01:15 up 5 days, 18:54, load average: 1.27, 1.32, 1.39
DiskStation> cat /proc/loadavg
1.45 1.37 1.41 2/127 26267
DiskStation>
How modify function in cpu.php for properly display?

THX

Regards,
 

somus1735

Member
May 25, 2018
833
0
16
That's true.

Autodetection cpu's works ok on DS412+ and shows: 4 and no need change this variable.

Code:
DiskStation> cat /proc/stat | grep -v "^cpu " | grep -c "^cpu"
4
It's not the problem. When I modify rCPU class in cpu.php to:

return( round(min(($arr[0]-1)*100/$this->count,100)) );

Then bargraph show 30-80% usage, but it's not very real too ;(.

Regards,
 

somus1735

Member
May 25, 2018
833
0
16
realy after change in conf.php variable to: $processorsCount = 4; and remove cpu.dat
not working OK sad.gif and creates again new cpu.dat with:

O:4:"rCPU":2:{s:4:"hash";s:7:"cpu.dat";s:5:"count";i:1;}​

Now I test and set manualy in cpu.dat file:

O:4:"rCPU":2:{s:4:"hash";s:7:"cpu.dat";s:5:"count";i:4;}​
then seems works ok and bargraph show 10-45%

Why variable on conf.php not working?

Regards,
 

somus1735

Member
May 25, 2018
833
0
16
Thanks for reply.
I tried today morning and not working with main conf.php to ;(
Which php file create and writes atributies to cpu.dat - cache.php or utils.php or cpu.php or other ?
I have one question yet. Where I may change refreshing time and dynamic of changes on bargraph?
Eg. after peak 10% to 80% usage and stable 80% load bargraph show it slow eg. 10%, 15%, 20%, 25%, 30% .... 80% after few seconds.

I don't know PHP very well.

Regards,
 

somus1735

Member
May 25, 2018
833
0
16
I checked revision from svn -> checked out revision 2456.

After set in conf.php $processorsCount = 4; file cpu.dat hasn't been created sad.gif
After set $processorsCount = null; file cpu.dat has been created with:

O:4:"rCPU":2:{s:4:"hash";s:7:"cpu.dat";s:5:"count";i:1;}​
Command recognition CPU's from cpu.php gives:

Code:
DiskStation> grep -c processor /proc/cpuinfo
4

I have PHP:

Code:
DiskStation> php -v
PHP 5.3.27 (cli) (built: Nov 6 2013 05:31:27)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
DiskStation>

on my NAS.

Regards,
 

somus1735

Member
May 25, 2018
833
0
16
Problem resolved - needs to change on Synology 'Web Services' settings:

Control Panel -> Web Services -> PHP Settings and check off option: 'Enable PHP safe_mode_exec_dir access limitation' and applay.

Then scripts works OK.

Regards,