[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:hardware:processor_affinity [2013/01/13 18:04 (UTC)] – [Processor affinity] hazel | howtos:hardware:processor_affinity [2013/01/13 18:12 (UTC)] (current) – [Taskset] hazel | ||
---|---|---|---|
Line 17: | Line 17: | ||
Because the scheduler will do its best to keep processes running on the same CPU (as long as this is beneficial to overall performance) you usually do not have to interfere. However, some cases warrant pinning a process to a single CPU or a predefined subset. Let's look at two examples; the second will be discussed in more detail. | Because the scheduler will do its best to keep processes running on the same CPU (as long as this is beneficial to overall performance) you usually do not have to interfere. However, some cases warrant pinning a process to a single CPU or a predefined subset. Let's look at two examples; the second will be discussed in more detail. | ||
- | - Commercial database vendors like [[http:// | + | - Commercial database vendors like [[http:// |
- One process on a busy server is eating so many of your multi-CPU processor cycles that other programs' | - One process on a busy server is eating so many of your multi-CPU processor cycles that other programs' | ||
Line 28: | Line 28: | ||
- | Slackware has a tool for setting the processor affinity for a certain task or process. It is called "'' | + | Slackware has a tool for setting the processor affinity for a certain task or process. It is called "'' |
< | < | ||
Line 38: | Line 38: | ||
0xffffffff means all processors (#0 through #31) | 0xffffffff means all processors (#0 through #31) | ||
</ | </ | ||
- | Luckily you can use human-readable numbers instead of a bitmask if you add the " | + | Luckily you can use human-readable numbers instead of a bitmask if you add the " |
Examples: | Examples: | ||
Line 47: | Line 47: | ||
</ | </ | ||
$ taskset -cp 1 1337 | $ taskset -cp 1 1337 | ||
- | </ | + | </ |
- | * To start a new process with a fixed CPU affinity, you omit the " | + | * To start a new process with a fixed CPU affinity, you omit the " |
$ taskset -c 3 java -Xmx1024M -jar minecraft_server.jar nogui | $ taskset -c 3 java -Xmx1024M -jar minecraft_server.jar nogui | ||
</ | </ |