Taskset on multicore cpu
Hi all I wanted to ask is there a way to migrate a proces from one core of cpu to another core of the same cpu with taskset.
Regards |
man taskset
|
Hi again and thanks for your reply.
I read the man and info pages. Let me first make my situation a bit clearer. I installed the squid as a web-cache server. When runing in testing envoriment I had great performances. I had 2* dual core cpu and I created 2 instances of squid and set afinity for each on a single cpu. Worked great. Now in real life I am using 2* quad core cpu processor server and I can do the same but when I reach 300MB traffic my server responds slowely. I am curious can I make 2 or even 3 instances of squid per cpu like 1 instance run on cpu 1 core 1, second on cpu 1 core 2, third cpu 1 core 3, fourth cpu2 core 1, fifth cpu 2 core 2 and six on cpu2 core 3. Is somethink like this possible since I have 3 cores on each cpu's sleeping while a core is working on 100%. I know that on non intensive proceses the taskset is helpful on isolating proceses on one cpu or even a core, but in my cause I want to balance the usage of procesors since squid uses only 1 process not create child processes (can not say if it is a bad idea or not - limited knowledge on computing arcitecture :) ). Thanks in advance. p.s. sorry my bad english. |
Quote:
I have four cores: Code:
alucard@karrde:~$ cat /proc/cpuinfo | grep "model name" Code:
alucard@karrde:~$ sudo taskset -c -p 3 32039 |
Quote:
As for forcing particular instances of a program onto a particular core, that can sometimes be beneficial - usually not worth the hassle, but certainly might be worth a try in your case. You could use taskset when starting each instance, but I generally use cgroups when I want/need to isolate workloads - usually for testing in my case. It's really designed to isolate a group of workloads to a group of processors, but you could use it to do what you want. Can be a bit fiddly to setup, but have a look at ../Documentation/cgroups in your kernel source tree (used to be called cpusets). |
All times are GMT -5. The time now is 03:00 PM. |