Quantcast
Channel: Admins Goodies » multi-core
Viewing all articles
Browse latest Browse all 10

How can I run command and select core to be used

$
0
0

Question

I have a command to run (in this case is a php5 script) and I would like to know if there is something to run this command and select the core to be runed.

What I want to do is to run 1 command per each core to use the multiple cores of my server.

Any idea? Or I have to rewrite the script in other languages with multicore support and develop the core control directly in the script?

Asked by enedebe

Answer

The command to run or assign a specific command to a particular core is taskset.

Embed it in your startup script or use from the command line like:

taskset -c 0,5 command_name -c is a list of one or more CPUs to run the command on; in this case, core 0 and 5.

You can also modify the core assignment of a running process by specifying a PID with taskset.

But you may also want to see: Assigning Processes to CPU Cores

Answered by ewwhite

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images