Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
55
rated 0 times [  55] [ 0]  / answers: 1 / hits: 41224  / 1 Year ago, mon, november 21, 2022, 1:29:03

I'm trying to run a bunch of scripts related to a gaming server in Terminator. The only problem is when I do this, Terminator detects all my CPU cores and the PC lags. Is there any way to start it up but trick it into thinking I only have 1 CPU core?


More From » cpu

 Answers
5

It is not terminator that is doing the "spreading" on all the CPU of a given process. Linux itself (the kernel) is doing this. A task (process) is scheduled as available to run on all CPUs by defaults; if it uses threads it can uses more than one CPU at a time.



To restrict a process to a specific CPU, you use the command taskset.



taskset --cpu-list 1,2 my_command 


This command forces my_command to run just on CPUs #1 or #2.



To learn more, type man taskset or search for "linux CPU affinity" (first hit here).


[#24615] Monday, November 21, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hical

Total Points: 498
Total Questions: 106
Total Answers: 117

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
;