Looking for better ideas how how to sleep/suspend my unraid box


Recommended Posts

I only said thirty minutes for the sake of argument.

My thinking was, if thre's been NO network activity in the past N minutes, and if all disks are asleep, then it is ok for the server to go to sleep.

 

OK. Agreed. If you can script to do that without bwm-ng, it would make sense to do it in the simplest manner.

Link to comment

I've attached an updated version of the sleep script. The main aim was to repackage the various bits of functionality that different people have proposed already. There's little new functionality, but everything has been nicely parameterized for easy configuration. It should also be easy to re-code the various activity checks.

 

The central logic of the script is that countdown to server sleep proceeds in three consecutive steps

 

0) unRAID puts the HDDs to sleep, absent access to their (uncached) content

1) a timeout after last HDD goes to sleep [original sleep counter]

2) a timeout after last external activity, currently

    * TCP access over some 30sec window within the current 1-minute countdown tick

    * ping of specific IP addresses, to ascertain whether media players, etc., are online

-) the countdown may be suspended altogether at certain hours.

 

If any previously timed-out conditions are re-activated, subsequent time-out counters are reset.

 

The attached script should make it straightforward to configure whether and how to do each of these and for how long, and whether to re-new DHCP and re-negotiate for a gigabit connection upon wake-up, and more.

 

Link to comment

I've attached an updated version of the sleep script. The main aim was to repackage the various bits of functionality that different people have proposed already. There's little new functionality, but everything has been nicely parameterized for easy configuration. It should also be easy to re-code the central activity checks.

 

The central logic of the script is that countdown to server sleep proceeds in three consecutive steps

 

0) unRAID puts the HDDs to sleep, absent access to their (uncached) content

1) a timeout after last HDD goes to sleep [original sleep counter]

2) a timeout after last external activity, currently

    * TCP access over some 30sec window within the current 1-minute countdown tick

    * ping of specific IP addresses, to ascertain whether media players, etc., are online

-) the countdown may be suspended altogether at certain hours.

 

If any previously timed-out conditions are re-activated, subsequent time-out counters are reset.

 

The attached script should make it straightforward to configure whether and how to do each of these and for how long, and whether to re-new DHCP and re-negotiate for a gigabit connection upon wake-up, and more.

 

 

This is great, just what I needed! Thanks! :)

Link to comment

Very nice ReneV.  I am going to implement and test for a while before updating the S3 wiki page, unless someone beats me to it.  But it looks like you have cleanly rolled in all of the various topics that we've been discussing in this thread.  (I am about to leave for a week - so it may be a while)

 

One thing, and I hesitate to even mention it yet because I really haven't isolated the problem - but I suspect that some of the issues I've had with my server lately where it would just go unresponsive after moving large files back and forth may be related to operation after wake from S3.  More specifically, I think it might have to do with the forcing of a Gb connection after sleep, when my server would normally only have negotiated a 100Mb connetion.  Originally I thought it was a 4.5b7 issue, but I reproduced the problem quite easily in 4.4.2 which was an otherwise very stable release for me.  I implemented that Gb force line in my S3 script without extensive testing, so I want to make sure it gets due attention . . .

 

agw

 

Link to comment

The attached script should make it straightforward to configure whether and how to do each of these and for how long, and whether to re-new DHCP and re-negotiate for a gigabit connection upon wake-up, and more.

 

Also makes a fine lesson in scripting / structured coding for a novice to learn from.

 

Thanks for putting in the time and effort to make this professional grade.

Link to comment

[...] issues I've had with my server lately where it would just go unresponsive after moving large files back and forth may be related to operation after wake from S3.  More specifically, I think it might have to do with the forcing of a Gb connection after sleep, when my server would normally only have negotiated a 100Mb connetion. [...]

 

I would be extremely surprised if forcing a Gb network connection had any sort of negative consequences unless, that is, there's serious issues with the drivers, with driver/hardware compatibility, or with the hardware itself.

Link to comment

Apologies for my ignorance. Between this thread and the wiki I am still thoroughly confused. What exactly do I need to do here to make this work?

 

Hard to help without knowing what is confusing you.

 

In the wiki agw explains how to install an s3.sh script which he links to. That script works fine as intended but does not include all the features and customizations we have been talking about and adding recently.

 

If you want to take advantage of those new features then install ReneV's latest s3_notHrHdTcpIp.sh script in the same manner described in the wiki. But be sure to use a text editor to edit the configurable options in the script to suit your needs before running it. [Edit: You also will need to install bwm-ng.]

Eventually someone will update the wiki to incorporate the new script and its features. Meanwhile, if you have specific questions just ask them.

Link to comment

Please don't take this bold text as me yelling or anything like that, I just want people to pay attention to it.

 

Anyway, would anyone who has S3 working PLEASE private message me so I can update the wiki (or update it yourself).

Just send me:

  • The motherboard you are using
  • The version of unRAID you are using
  • Your overall experience and happiness with S3

Also, please post this same info you send me in this thread so that I have an easy place to link to and others have a place to quickly glance at the list.

Link to comment

Motherboard: GIGABYTE GA-MA785G-UD3H

 

S3 works great. I modified the S3 script a little to fit my needs (attached). I want to be able to pass a start/end, and delay ad parameters, but it works great so far.

 

unRaid 4.5b8

Just a stupid question .. I have search, but how do you start this script? from the GO file? for this script needs to be running all the time and check if the drives are spunn down ?

 

Please....

 

Tahnks

 

Peter

 

 

Link to comment

[Just a stupid question .. I have search, but how do you start this script? from the GO file? for this script needs to be running all the time and check if the drives are spunn down ?

 

From the wiki:

10. Edit ‘go’ file to call script

 

    * I added the following lines to my go script to initiate the sleep script during boot:

 

# Execute s3.sh sleep script

fromdos < /boot/custom/bin/s3.sh | at now + 1 minute

 

    * Make sure you adjust file directory structure as necessary depending upon where you saved your s3.sh script.

Link to comment

I've attached an updated version of the sleep script. The main aim was to repackage the various bits of functionality that different people have proposed already. There's little new functionality, but everything has been nicely parameterized for easy configuration. It should also be easy to re-code the various activity checks.

 

The central logic of the script is that countdown to server sleep proceeds in three consecutive steps

 

0) unRAID puts the HDDs to sleep, absent access to their (uncached) content

1) a timeout after last HDD goes to sleep [original sleep counter]

2) a timeout after last external activity, currently

    * TCP access over some 30sec window within the current 1-minute countdown tick

    * ping of specific IP addresses, to ascertain whether media players, etc., are online

-) the countdown may be suspended altogether at certain hours.

 

If any previously timed-out conditions are re-activated, subsequent time-out counters are reset.

 

The attached script should make it straightforward to configure whether and how to do each of these and for how long, and whether to re-new DHCP and re-negotiate for a gigabit connection upon wake-up, and more.

 

 

Hi. great script, did this also spinn upp drives when I starting my media player ? as the "spinn_drives" script ?

 

 

Link to comment

spinn upp drives when I starting my media player?

 

No, it does not. The closest it gets is to prevent the server from going to sleep when your media player is on, either because the media player is accessing the drives on the server or because you have configured the script to ping the media player.

Link to comment

When I wake my server from S3, it always spins up all drives and does some reinitialization on the ports.

I have two questions:

1.) Do others get those errormessages on inizialization also? Is it something to be worried about or is it harmless?

2.) Did anybody find a solution to AVOID the spinup of the drives after WOL? So that just the drives being accessed spin up as in normal operations? I would be interested in a solution or hints into the right direction.

 

Thanks, Guzzi

 

 

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.05: SATA link up 1.5 Gbps (SStatus 113 SControl 320)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2.00: failed to IDENTIFY (I/O error, err_mask=0x11)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2.00: revalidation failed (errno=-5)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2.15: hard resetting link

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2: controller in dubious state, performing PORT_RST

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.00: failed to IDENTIFY (I/O error, err_mask=0x11)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.00: revalidation failed (errno=-5)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.15: hard resetting link

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1: controller in dubious state, performing PORT_RST

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata2.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Nov 17 22:37:04 XMS-GMI-02 kernel: ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Link to comment

When I wake my server from S3, it always spins up all drives and does some reinitialization on the ports.

I have two questions:

1.) Do others get those error messages on inizialization also? Is it something to be worried about or is it harmless?

 

I get the following softreset errors:

 

Nov 17 16:51:02 Tower kernel: sd 3:0:0:0: [sdb] Starting disk

Nov 17 16:51:02 Tower kernel: ata5: softreset failed (device not ready)

Nov 17 16:51:02 Tower kernel: ata3: softreset failed (device not ready)

Nov 17 16:51:02 Tower kernel: ata6: softreset failed (device not ready)

Nov 17 16:51:02 Tower kernel: ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Nov 17 16:51:02 Tower kernel: ata3.00: configured for UDMA/133

Nov 17 16:51:02 Tower kernel: sd 5:0:0:0: [sdc] Starting disk

Nov 17 16:51:02 Tower kernel: ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Nov 17 16:51:02 Tower kernel: ata5.00: configured for UDMA/133

Nov 17 16:51:02 Tower kernel: sd 6:0:0:0: [sdd] Starting disk

Nov 17 16:51:02 Tower kernel: ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Nov 17 16:51:02 Tower kernel: ata6.00: configured for UDMA/133

Nov 17 16:51:02 Tower kernel: Restarting tasks ... done.

 

Doesn't seem to have any functional impact though.

 

Link to comment

Did anybody find a solution to AVOID the spinup of the drives after WOL?

 

No and you won't.... ACPI doesn't provide for it.  Even for drives with power management that will power up in spin-down mode, it won't work.

 

...so the script you have posted somewhere else for WD drives to get staggered spinup also doesn't work for it? So the reinitialization process includes a command to the disk that ALWAYS spins up the drive?

I am not experienced nor do I know enough about the ata protocol and that stuff, just want to make sure i properly understand that and why it's working or not working.

Thanks, Guzzi

Link to comment

Motherboard: GIGABYTE GA-MA785G-UD3H

 

S3 works great. I modified the S3 script a little to fit my needs (attached). I want to be able to pass a start/end, and delay ad parameters, but it works great so far.

 

unRaid 4.5b8

Kapperz, do you get proper videosignal on the monitor after WOL from S3? I have the precedor of this board (GA-MA780G) and suffer from that problem. No other functional issues beside this. There were hints using S2RAM, but I couldn't find a working slackwarepackage.

Thanks, Guzzi

Link to comment

Did anybody find a solution to AVOID the spinup of the drives after WOL?

 

No and you won't.... ACPI doesn't provide for it.  Even for drives with power management that will power up in spin-down mode, it won't work.

 

Does this mean WD drives jumpered to "Not Spin up After Resume from S3" with still spin up -  or does it only spin up HDD's connected via ACPI?

Link to comment

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.