Trying to develop an integration with the operating system would require that our users only use very specifically configured servers. This is completely impractical for mass-distributed software like ours.
There are much simpler solutions.
First and foremost, you should be taking backups when your server is at a low utilisation which is usually in the middle of the night.
Stuck PHP threads are not really a problem, except for the fact that you seem to have a problematic NFS mount policy. Still, you can of course take backups using a user account which has a CPU usage limit (ulimit -t
) that's enough for taking a backup, with a little bit of headroom, but not as big as to allow a stuck thread to be an issue.
Regarding the NFS mounts, you can change the mount options to have a faster failure if connectivity to the remote end is lost for any reason. Out of the top of my head, you can use softerr
or hard
instead of soft
for delayed or immediate transfer errors respectively, and set retry=2
for a maximum locking time of 2 minutes (instead of the default which can be up to 10000 minutes, which is almost a week!), or even retry=0
for an immediate error (which might not be an option if you are connecting to the NFS mount over the Internet instead of an internal network). A failed disk operation will cause a backup failure which, of course, results in the thread terminating instead of lingering forever while potentially locking I/O in the kernel.
Another option is, of course, to not go through NFS at all. Instead, have the backup transfer the archives to the remote server over SFTP (Upload to Remote SFTP Server post-processing option). Along with the Process Each File Immediately you will be uploading each backup archive part as it is created, not taking up too much space on the web server.
Don't try to overengineer and overcomplicate a solution to what is garden variety network issues affecting NFS connectivity. They won't work as well as the standard mount options which have been around for decades and have been tried and tested by hundreds of thousands of IT professionals on countless servers.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!