linux - Run several jobs parallelly and Efficiently -


os: cent-os

i have 30,000 jobs(or scripts) run. each job takes 3-5 min. have 48 cpus(nproc = 48). can use 40 cpus run 40 jobs parallelly. please suggest script or tools can handle 30,000 jobs running each 40 jobs parallely.

what had done:

  • i created 40 different folders , executed jobs parallely creating shell script each directory.

  • i want know better ways handle kind of jobs next time.

as mark setchell says: gnu parallel.

find scripts/ -type f | parallel 

if insists on keeping 8 cpus free:

find scripts/ -type f | parallel -j-8 

but more efficient use nice give 48 cores when no 1 else needs them:

find scripts/ -type f | nice -n 15 parallel 

to learn more:


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -