Date: Wed, 20 Feb 2019 17:35:21 +0000 From: "Farhan Khan" <farhan@farhan.codes> To: freebsd-hackers@freebsd.org Subject: Optimize execution of processes by CPU core Message-ID: <2fcd9aee092730e11880c3ae88de4898@farhan.codes>
next in thread | raw e-mail | index | archive | help
Hi all, I am trying to optimize the execution of a CPU-intensive workload where I am running multiple instances of a program. The moment the program ends (expected behavior), the calling shell script verifies the results and if its good it reruns the program. The machines I am running this on have 8 cores, but ps reports that some of the processes frequently run on the same CPU, so I suspect I am not getting optimized performance. If possible, and if most efficient, I would like to run each process on its own CPU core. Are there any best practices on how to run something like this? I understand cpuset can perform some functionality around this, but I do not understand the tooling (The man page speaks of a CPU set?) Would I do something like "cpuset -c -l 0 program arg1 arg2 arg3" in one script, and then "cpuset -c -l 1 program arg1 arg2 arg3" in the next up to 7? Obviously it would be best to re-write the program to handle multiple threads in in an optimized way, but that would take more time than the optimization would likely save. Thanks, --- Farhan Khan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2fcd9aee092730e11880c3ae88de4898>
