Questions tagged [taskset]

22 questions
17
votes
1 answer

How to set CPU affinity in Go

I'm using isolcpus to assign a subset of the total CPU cores only for kernel tasks. This means that I can use the reminder for other tasks. I noticed when I run the tests/benchmarking tool from go, all the kernel processors are used (using htop).…
Andrei
  • 7,509
  • 7
  • 32
  • 63
10
votes
3 answers

Locust: how I share auth cookie with the rest of tasks only for current locust user?

I am looking into to moving my multi-threaded python script to locust. A simple explanation of what my script does is: Create a thread per user In each thread authenticates user and get auth cookie With that auth cookie perform various api calls at…
Alex D
  • 703
  • 2
  • 7
  • 23
5
votes
1 answer

How to get the number of available cores in python

The standard method that I know to get number of cores in python is to use multiprocess.cpu_count import multiprocessing print(multiprocessing.cpu_count()) Also, when creating a task we can specify some cores that the process can access using…
Bob
  • 13,867
  • 1
  • 5
  • 27
4
votes
1 answer

Can I taskset a process inside container/docker?

Can I taskset a process inside container/docker? How can I tell which cpu cores are assigned to this container? I want to taskset a process to some specific cpu cores to get better performance.
Dongfang Qu
  • 341
  • 1
  • 11
3
votes
1 answer

linux taskset: Does a thread of a multi-thread process always run on a particular core?

I use the taskset to set a multi-thread process to run on a Linux host as below: task -c 1,2 ./myprocess Will a particular thread always run on a particular CPU, for example, thread 1 always run on c1? or it will run on c1 or c2 at different times?
flyisland
  • 397
  • 2
  • 8
2
votes
0 answers

How to re-enable CPU Cores after isolcpus

I'm running some processes on a Jetson NX and I was trying to isolate 3 of the cores so I could use taskset and dedicate them to my python script which incorporated multi processing. To do this, I followed a few tutorials and modified my…
Chealsie
  • 33
  • 6
2
votes
1 answer

What is the best way to pass arguments from a locust user to taskset parameters, where the tasksets have been separated to different files?

entry_point.py from other_file import UserBehaviour class ApiUser(HttpUser): tasks = [UserBehaviour] def on_start(self): # log in and return session id and cookie # example: self.foo = "foo" other_file.py from entry_point import…
Xen0byte
  • 89
  • 9
2
votes
1 answer

Check value of PF_NO_SETAFFINITY

Is it possible to tell whether a process/thread has the PF_NO_SETAFFINITY flag set? I'm running taskset on a series of process ids and some are throwing errors of the following form: taskset: failed to set pid 30's affinity: Invalid argument I…
Will
  • 1,171
  • 2
  • 14
  • 26
2
votes
1 answer

Set the process affinity on a large number of processes

I'm running taskset over a large number of pids (500+). The total time is 30s+. Is there a fast way to set many pids to the same cpu? It doesn't improve performance much to run the taskset processes in parallel.[1] Thanks! [1] I tried both…
Will
  • 1,171
  • 2
  • 14
  • 26
1
vote
2 answers

how to allocate processor to exec process

I can allocate a cpu core to a process, by running it like this: taskset -c 21 ./wait xx Here, ./wait is an executable, whose code is shown below, and I am trying to assign the core=21 to this process. But when I try to do the same from another…
R71
  • 4,283
  • 7
  • 32
  • 60
1
vote
2 answers

How do I limit using one CPU per python processes launched via gnu parallel?

If I run this script $ seq 1 4 | taskset -c 0-3 parallel -j4 -u Then each python process contained in the runs on multiple cpus instead of one. The python function use both numpy and pytorch. So the option…
Mariod
  • 11
  • 1
1
vote
0 answers

How does CPU affinity affect Linux Real time guarantees?

I am envisioning a linux architecture like this: -------------------- | LEGACY APPLICATION | ---------------------------------------- | AMAZING APPS | LINUX KVM PLATFORM…
Ace
  • 1,501
  • 4
  • 30
  • 49
1
vote
1 answer

Processes running on a particular core

I used taskset to pin a process to a particular core but there are other processes as well which share that core. Is it possible to know which processes share which cores explicitly? For example to get an information like "core 0 has processes 1,…
Sabster
  • 89
  • 1
  • 12
1
vote
1 answer

Pass cpu affinity to julia's child processes

I am trying to control the CPU affinity of julia using taskset using taskset -c 1,2 julia Foo.jl However, internally Julia spawns may child processes to which this affinity mask does not seem to apply. So mu question is: can I force a process and…
gertian
  • 123
  • 5
0
votes
0 answers

taskset: operation not permitted, for executable with setcap all=ep, in a docker container, specifically hosted by wsl 2

I'm hitting an error in a docker container, that seems to be related to the host running the docker container. I'm unable to use taskset to run an executable, in an Ubuntu docker container hosted on Docker Desktop for Windows 10, with Ubuntu wsl 2…
Ryan Franz
  • 133
  • 5
1
2