情况: 我可以访问 3 个远程服务器。一项工作需要一天或更长时间才能在服务器中完成。我想在较早的工作完成后自动开始另一项工作。我不是这些远程机器的管理员。
有没有办法知道作业何时完成(或 CPU 负载何时降低到阈值以下)然后运行下一个作业(可能在特定目录中运行一些 shell 脚本)?
最终,一个类似于 PBS 或 SLURM 的系统(不是那么稳健的想法)。
可行吗?
最佳答案
使用在大多数 unix/linux 上广泛可用的 batch
命令
来自手册页
batch executes commands when system load levels permit; in other
words, when the load average drops below 0.8, or the value
specified in the invocation of atd.
要设置平均负载达到新批处理开始执行点的级别,请将 -l 选项传递给 atd。来自手册页
OPTIONS -l Specifies a limiting load factor, over which batch jobs should not be run, instead of the compile-time choice of 1.5. For an SMP system with n CPUs, you will probably want to set this higher than n-1.
因此,在具有 4 个 CPU 的系统上,如果平均负载为 3.5,则有足够的东西在运行以保持 3 个半 CPU 繁忙。
如果您的工作一次可以使用 2 个 cpu,那么您可能希望在 4 个 cpu 系统上将 -l 设置为 1.9
关于linux - 在远程工作站中提交没有队列管理器的作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35920286/