There three obstacles here:
1. What exactly triggers the autosuspend. Eg. xautolock an run random scripts, but the big DEs rely, I believe, on systemd signals. Not sure to what degree this is manipulatable.
2. System load can happen in bulks and your network traffic can stall on the other side, eg. there might be no traffic for several seconds despite an ongoing download - how do you define "load"?
3. How to abort the pending suspend? eg. you didn't interact, system waits for cpu load to drop, you start typing or moving the mouse. How do you figure that you want to abort the suspend and do you actually want to?
It is abysmally easier to notice that there's been no network I/O for 5 minutes and suspend the system...
]]>However, it's permit to inhibate the general suspend when it will occurs, so you have to remember to launch it when you have a long task to run.
I wish "not have to remember" way.
On Synology Nas, there is a package which is doing this well : https://sourceforge.net/projects/advpowermgr4ds/
So it should be possible to have the same on a running Linux...
]]>And ideally, if the CPU is high (because I'm rendering a 3D project for example), I would appreciate don't suspend the computer before the end of the job.
What is the best way to doing this kind of stuff by targeting values for each test ?
Do you have script I can adapt for my needs ?
Thanks
]]>