Menu

Need details on delayed shutdowns mechanic

Help
Isaac Obai
2016-09-28
2016-09-28
  • Isaac Obai

    Isaac Obai - 2016-09-28

    Hi,

    I was wondering how exactly delayed shutdowns are working.
    If I plan a daily shutdown at 1:00 am, a daily bootup at 8:00 am, and set the "connections Number" plugin to do a measurement every 60min (measures per interval : 1), obviously to try to shutdown if there isn’t any active connection every 60 minutes :

    -When Advanced Power Manager will consider that the scheduled shutdown is obsolete if there are active connections? Will it test them infinitely, or until the scheduled bootup (so 8 am in this case), until the next day ?
    In brief, how many test will it perform ?
    -There are some predefined values for “Measurement interval in minutes”, “Number of measures per interval”, and so on. Is it ok to set higher values? Like 60 minutes for intervals (max predefined value is 10).

    On a side note : maybe another setting like “Number of measurements to process”, or simply “Time after the scheduled shutdown will become obsolete”, would be welcome to be able to plan it.

    Anyway thank you very much for your work. APM seems to be a fantastic tool that will fit exactly what I need. Keep up the fantastic work ! :)

     

    Last edit: Isaac Obai 2016-09-28
  • Renaud Métrich

    Renaud Métrich - 2016-09-28

    The shutdown plugins run AFTER shutdown time has been reached only MINUS the measurement interval in minutes.
    Of course, if the clock reaches a wakeup, the shutdown will be cancelled.
    By default, most of the shutdown plugins have a measurement interval of 1 minutes and a number of measures of 1, this means that every minute, a check will be made.

    If you set measurement interval to 10 minutes and number of measures to 2, the check will happen every 5 minutes (10 / 2), AND, if during 10 minutes (so basically 2 checks) no activity was found, the plugin will return "I'm done" and NAS will shut down.

    If you set measurement interval to 60 minutes and number of measures to 1, the check will happen every 60 minutes (60 / 1), so basically if you planned shutdown at 22:00, it will check at 21:00 (22:00 minus 60 minutes), then 22:00, 23:00, 00:00, etc. This is not optimal because your NAS may remain up for 1 hour too much (say you stopped watching TV at 22:01, then it will wait until 23:00 to discover you're in bed).
    To optimize, lower the interval to something like 10 minutes. In such case, it will check every 10 minutes, starting in our case at 21:50. So if you stopped your TV at 21:45, it will shut down at 21:50. If you stopped your TV at 22:01, it will shutdown at 22:10.

    Increasing the number of measures prevents the NAS from shutting down inadvertedly, typically because your wife (real life example ;-) ) shut down the TV at 21:55 and you turned it on again at 22:05, then if you had a number of measures to 1, the NAS would have shut down at 22:00.
    With a number of measures of 6 (and still 60 minutes measurement interval), the hole would have been filled.

    You can change to any value you want, there are integrity checks performed on the user interface side and also on the backend side.

    To conclude:
    - lowering the interval enables to shut down more rapidly
    - increasing the number of measures enables to avoid "holes"

    Hope this helps,
    Renaud.

     
  • Isaac Obai

    Isaac Obai - 2016-09-28

    Hi Renaud,

    Tyvm for your answer !
    I was also wondering in what a 60/6 or a 10/1 cycle were different.

    If I understand well (not sure at all ^^) an interval of 60 mins with 6 mesures (60/6) is different of 10/1, but not only cause they won't start at the same time ?

    -> 60/6 also means that every 10 mins during the cycle of 60 mins, it will check if my TV is on for example. If it is at any of the 6 tests, the 60/6 cycle restart, and the shutdown is delayed for 1 hour from the last positive check.

    So if I take your example : shutdown at 22:00, 60/6, "hosts" plugin pings my TV.
    The 1st check is at 21:00, last at 21:50
    1) If TV is off during the 6 tests -> nas shut down at 22:00
    2) If TV is on at 21:50, but off at 21:55 and for the rest of the night -> nas will shut down at 22:50 (last positive check at 21:50).

    Am I right ?

     

    Last edit: Isaac Obai 2016-09-28
  • Renaud Métrich

    Renaud Métrich - 2016-09-28

    Exactly. So it is better to lower the interval of computation.

     
  • Isaac Obai

    Isaac Obai - 2016-09-28

    Perfect sir ! That's very nicely done.
    Tyvm again. Have a good day :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.