I am using AB as benchmark tool for performance analysis on apache server. Is there any way, we can restrict the AB request to specific CPU cores by setting their mask? I tried with sched_setaffinity() but it restricts the AB request to a single particular core instead I want to restrict it to specific cores . For examples : If I set mask- 0xf0 CPU cores 2,4,6 get disabled.
Asked
Active
Viewed 331 times
2 Answers
0
I don't think there is a specific way to do this.
You could do one of the following:
- Restrict the concurrency level to control CPU usage.
- Use the operating system to assign the ab process to a particular Core.

Uatec
- 141
- 4
0
Can use taskset
like
taskset x ab -n 100 -c 12 http://localhost/index.html
to set the cpu affiinity to a certain core.
x
is the affinity mask and
x = 1 =>core 0
x = 2 =>core 1
x = 4 =>core 2
x = 8 =>core 3
Similarly odd numbered values for x
will enable two or more cores

auny
- 1,920
- 4
- 20
- 37