[Plugin] CA Auto Turbo Write Mode


Recommended Posts

  • 2 weeks later...

Hi! I installed this plugin which seems amazing (as all other Squid plugins ;) ) but it seems once turbo is enabled, it never spins down again the harddisks :(. I'm not using any cache disk, just an array with 5 disks + 1 parity. What can it be?

 

UPDATE: Sorry, I'm not sure right now if it's because this plugin. I've disabled it and the HDDs remain up almost always :(

Edited by almarma
Link to comment
  • 1 month later...
1 hour ago, leejbarker said:

Hi, I noticed that it has already been discussed combining Turbo Write and Threshold Mover Script. I can't get the damn thing to work, it just seems to freeze my system for a while.

 

Could someone post the script.txt file to make sure I'm not being an idiot?

 

Thanks

have you tried running the original custom mover script first without my mod?  From memory, my mod did work but I just use the normal script now

Link to comment
On 23/10/2017 at 9:11 AM, DZMM said:

It's working, but when mover is triggered I need to add turn TW off after mover has finished.  I think:

 


exec("/usr/local/sbin/mdcmd set md_write_method");

turns TW off, but how do I put a delay in to (i) not do this until mover has finished or (ii) hardcode a 30 min delay.  Have I used sleep correctly?

 


#!/usr/bin/php
<?PHP
$moveAt = 85;                 # Adjust this value to suit (% cache drive full to move at)
$runDuringCheck = true;     # change to true to run mover during a parity check / rebuild

$diskTotal = disk_total_space("/mnt/cache");
$diskFree = disk_free_space("/mnt/cache");
$percent = ($diskTotal - $diskFree) / $diskTotal * 100;

if ( $percent > $moveAt ) {
  if ( ! $runDuringCheck ) {
    $vars = parse_ini_file("/var/local/emhttp/var.ini");
    if ( $vars['mdResync'] ) {
      echo "Parity Check / Rebuild Running - Not executing mover\n";
      exec("logger Parity Check / Rebuild Running - Not executing mover");
    } else {
      exec("/usr/local/sbin/mdcmd set md_write_method 1");
      exec("/usr/local/sbin/mover");
	  sleep 1800;									# trying to put a 30 min pause in
	  exec("/usr/local/sbin/mdcmd set md_write_method");
    }
  } else {
    exec("/usr/local/sbin/mdcmd set md_write_method 1");
    exec("/usr/local/sbin/mover");
	sleep 1800;										# trying to put a 30 min pause in
	exec("/usr/local/sbin/mdcmd set md_write_method");
  }
}
?>

 

 

How did this work for you? I think the to turn TW off you need to set it to md_write_method 0

Link to comment
1 hour ago, leejbarker said:

 

How did this work for you? I think the to turn TW off you need to set it to md_write_method 0

set md_write_method

Turns it off.  I binned this script as I didn't know how to control turning it off automatically once mover had finished and I decided I was happy with mover running and going slowly as it's background activity i.e. I'm not sitting at the keyboard waiting for it to finish.  

Link to comment
1 minute ago, DZMM said:

set md_write_method

Turns it off.  I binned this script as I didn't know how to control turning it off automatically once mover had finished and I decided I was happy with mover running and going slowly as it's background activity i.e. I'm not sitting at the keyboard waiting for it to finish.  

 Ok, out of interest - did the sleep command work at all

Link to comment
  • 1 month later...

I just installed this plugin for the first time (I'm on unRAID 6.4.1), but it doesn't seem to detect that my drives are spun up when they are. Specifically, it thinks that two of them are down when all of them are up (I invoked the spin up command). I've waited more than the polling period, but it doesn't climb higher than 2. 

Two of my disks are encrypted - could it be related to that?

Screenshots attached.

Unraid_2down.png

Unraid_SpunUp.png

Link to comment

Interesting... to give you less to wade through in the log, I thought I'd reboot the machine to clear it before sending the diags, and after reboot, the script correctly detected that all disks were spun up, and turbo mode was enabled.

But a few seconds later, it incorrectly thought that one disk was spun down, so then disabled it.

Unfortunately, I didn't think to enable debug logging *before* I rebooted, so didn't enable it in time to catch this behaviour.

I'm happy to reboot again if it helps get to the bottom of the problem.

I've attached my diags, generated about 2 minutes or so after enabling debug (I have a 15 second time out). By this time the 'spun down' count had risen to 2 again.

percy-diagnostics-20180224-1133.zip

Link to comment
On 2/24/2018 at 7:03 AM, jademonkee said:

Just an update: it's now detecting that all disks are spun up again.

...and then to 1 disk spun down again.

Latest diags attached. 

 

percy-diagnostics-20180224-1159.zip

When the drives are spun up, it is returning active/idle from

hdparm -C /dev/sdX

 

Its a hair strange though that the command returns unknown when its spundown (I'm assuming).  Usually it states standby

 

Can you spindown all the drives and rerun the test?

 

My option here is that when it states "unknown" is to either assume thats its up or down or ignore it.  Currently I'm assuming anything other than "active" means spundown.

 

Unknown is only supposed to be returned when the drive doesn't support the command.  But it clearly does since the drives bounce between active/idle and unknown

 

Side Note:  I think that running this every 15 seconds is way way overkill

Edited by Squid
Link to comment
  • 2 weeks later...

If you don't have a cache drive and are using docker applications, then this plugin isn't for you.  Net result is that basically nothing will ever spin down.  Beyond that, it's really up to your own preference.  Power considerations vs speed

Link to comment
4 minutes ago, Squid said:

If you don't have a cache drive and are using docker applications, then this plugin isn't for you.  Net result is that basically nothing will ever spin down.  Beyond that, it's really up to your own preference.  Power considerations vs speed

 

I guess needed more info.  I have a 500gb SSD Cache drive.  Also bunch media dockers ie: binhex-delugevpn. binhex-jackett, binhex-nzbget, binhex-plexpass, binhex-radarr, binhex-sonarr and few other odds and ends. 

 

I use server for plex and streaming all the media in the house and on the road.

Link to comment
  • 3 months later...

Is there a way to schedule automatic mode as per the settings? i.e. I want to turn turbo write off altogether overnight, but switch the automatic mode back on during the day - at the moment I can only turn turbo write ON during the day.

 

Thanks

Link to comment
7 minutes ago, DZMM said:

But in the morning I have to turn it back on via a 2nd schedule - will that be the plugins auto mode, or turbo write on all the time?

Looking at the code, it should work.  I'll have to get back to you

 

The log snippet from when it's in auto mode, then switching to the schedule, then when the schedule is finished would be helpful.

Edited by Squid
Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.