Run several jobs parallelly and Efficiently

后端 未结 3 1325
一整个雨季
一整个雨季 2020-11-30 14:28

OS: Cent-OS

I have some 30,000 jobs(or Scripts) to run. Each job takes 3-5 Min. I have 48 CPUs(nproc = 48). I can use 40 CPUs to run

3条回答
  •  旧时难觅i
    2020-11-30 15:11

    Just execute those scripts, Linux will internally distribute those tasks properly amongst available CPUs. This is upon the Linux task scheduler. But, if you want you can also execute a task on a particular CPU by using taskset (see man taskset). You can do it from a script to execute your 30K tasks. Remember in this manual way, be sure about what you are doing.

提交回复
热议问题