Auto reboot twice

I have a rule that reboots when free memory falls below 2200000. For whatever reason available free memory after reboot is significantly greater if the hub is then rebooted a second time. Approx 150000 greater. Is there a way to write the rule so that it reboots a second time, maybe 30
minutes later.
EDIT: This is answered in post 17.

Example of a second reboot. The last reboot is actually two, about 15 minutes apart. The first came back to less than 400000.

1 Like

Off the top of my head, no. The rule stops running on first reboot. You could add a rule that did stuff on bootup, but it would do it every time.
Now that I think about it, I think it might work if you had a text file that was created on first boot, then on restart, check if file is there, delete it and reboot.

Wouldn't a private boolean make it through a reboot?

I just assumed they didn't. Never thought to try, honestly.

Oh wait, of course they do. I use them (and Hub Variables) all the time, and they certainly retain.

That would probably be the easiest

I'm not sure how to use a boolean or variable to reboot the hub a second time after an auto-reboot but not in an endless loop.

@bbrannon I mean 220 is a little soon to reboot. Lower free memory doesn't mean lower performance in general. I would set my threshold to around 120. I've run on 85k for several days and didn't notice any real performance issues. JMO.. I only restarted because of the recent update. Overall my hangs around 180-220

image

Noted, and how to reboot twice in succession? There is a significant difference in available free memory after a second boot.

User @thebearmay's power outage manager. Create a virtual switch as a trigger...(there are probably other ways with this) [BETA]Power Outage Manager

You may have to play with the timing by adding some delays but I think this will work

1 Like

I think this should handle a second boot. Virtual switch gets turned on during low memory reboot.
Edit: this works.

I've been using an http post to reboot. Where do I access "reboot() on Hub Information". I have the Hub Information driver installed. Looking through the various rule action options is coming up empty for me. Obviously a forest for the trees thing :wink:

1 Like

@thebearmay

1 Like

Thanks, Got it. That's obscure.

1 Like

I kind of fell like there is a placebo effect happening here. I think it is more about timing then It is about what actually happens.

It would be interesting to see what would happen if the user would hit the url right after a reboot a few times and see if he got similar numbers. After one and then two reboots.

1 Like

See post#1.
I came to this conclusion some time ago. I've been tracking free memory via Hubigraph for several months and have noticed a significant jump in free memory after a second reboot following an auto restart from low memory < 220,000. Also after a hub update. When graphed it is rather obvious.

In the end, two rules. Low memory boot and reboot 15 minutes later if rebooted by the low memory rule. It was a useful exercise for me. Finally figured out the use of private booleans and an activator from a device.

image

1 Like

I'm just unsure what you think the boost in free memory on the second reboot is going to give you...

Free memory steadily declines. The significant drops are at overnight hub cleanup, seems like that doesn't work so well. If I start from 150,000 higher I would think it would add the time it takes to loose 150,000 to the time required to reach a reboot point. If nothing else it was a useful exercise for me.

Yes and no. From the reboot it declines at its greatest rate from the time of the reboot. Then as the days pass it declines less and less. My system takes about a week to level off and at that point Ih am around 200MB free.

Below is my grafana graph that shows the last 10 days

The thing that really doesn't make sense with your hypothesis about gaining memory is there is a reboot around 2/4 on that graph were the hub was not only rebooted, but completely shut down and disconnected from power.

I should point out on that graph the yellow line is my development hub with very little running on it. The green line is my prod hub that actually runs my house. So again the more it is doing the more memory will be consumed.