Docker Auto Pause for Parity Check


Recommended Posts

Some apps/dockers can cause Parity Checks to go slower due to competing reads/writes. As such it would be great if there was a way to pause specific dockers when a Parity Check Starts.

 

A pause is Ideal as it will 'unpause' on it's own after 24 hours. A 10TB array takes 24ish hours to do a Parity Check, so this works as a good solution.

 

The other option would be to shut off, again, certain apps, during a parity check. 

Link to comment
6 hours ago, eagle470 said:

A pause is Ideal as it will 'unpause' on it's own after 24 hours.

Where is that documented? I'm not aware of this, and since I script container pauses for some of my automation stuff, it would be nice to see if this behaviour can be changed.

 

BTW, it's easy to pause containers, just put this command in a bash script docker pause <containername>, so you could set a userscript to run when the parity check is scheduled that would pause all the containers you listed.

Link to comment
21 hours ago, jonathanm said:

Where is that documented? I'm not aware of this, and since I script container pauses for some of my automation stuff, it would be nice to see if this behaviour can be changed.

 

BTW, it's easy to pause containers, just put this command in a bash script docker pause <containername>, so you could set a userscript to run when the parity check is scheduled that would pause all the containers you listed.

 

It's not documented, but if you pause a container and leave it for 24 hours, it will restart. I'm not sure why that it is. This behavior is consistent every time I do it on my own array.

 

See the frustrating thing is the container name changes when ever you do an update. I don't' want to be constantly updating my container names in scripts.

Link to comment
3 hours ago, eagle470 said:

 

It's not documented, but if you pause a container and leave it for 24 hours, it will restart. I'm not sure why that it is. This behavior is consistent every time I do it on my own array.

 

See the frustrating thing is the container name changes when ever you do an update. I don't' want to be constantly updating my container names in scripts.

The pause behaviour has to something you have configured on your array, that's not normal. Perhaps you are doing a nightly backup using CA Backup?

 

As for the container name, I've never had one change on me.

What do you get when you list the container names?

docker inspect --format='{{.Name}}' $(sudo docker ps -aq --no-trunc)

 

Link to comment
On 2/3/2021 at 5:37 PM, jonathanm said:

The pause behaviour has to something you have configured on your array, that's not normal. Perhaps you are doing a nightly backup using CA Backup?

 

As for the container name, I've never had one change on me.

What do you get when you list the container names?


docker inspect --format='{{.Name}}' $(sudo docker ps -aq --no-trunc)

 

You'r right, I didn't even think about CA Backup, but oh well. 

 

I've had the COntainer ID change on me a few times, I don't recall why. I have new child brain right now, so I'm going to avoid doing anything that could be damaging.

Link to comment
21 hours ago, jonathanm said:

Yep. container ID != container name. Reference them by name and you will be fine. The container ID will change regularly, the name will not.

 

To build on this reply, I have a User-Script setup like the following that I was using when I had DPI turned on in my Unifi-Controller causing some really high memory usage over time.  So I had this script set to run once a week:

 

 

#!/bin/bash
#arrayStarted=true

docsrunning=$(docker ps | awk '{ print $2}')

echo "These Dockers are running"
echo $docsrunning

echo "Is 'unifi-controller' running?"

if [[ "$docsrunning" == *"unifi-controller"* ]]; then
    echo "Looks like it is, triggering a restart to reclaim memory"
    echo ""
    docker restart unifi-controller
fi

 

 

It could be cleaned up to include the docker name as a variable and stuff, but its something that someone can use as a reference for restarting dockers.

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.