wsperf icon indicating copy to clipboard operation
wsperf copied to clipboard

CPU affinity

Open oberstet opened this issue 12 years ago • 0 comments

When running multi-threaded (or also with a single thread and with testee on same machine), it seems important for performance (absolulte and consistency) to set the CPU core affinity of each thread.

E.g. I have now implemented that in the Autobahn testee and was able to bring down (essential more than half!) Median and Q90 latencies:

     Min:       1.5 ms
      SD:      21.0 ms
     Avg:      24.8 ms
  Median:      16.7 ms
  q90   :      42.9 ms
  q95   :      75.1 ms
  q99   :     105.3 ms
  q99.9 :     122.6 ms
  q99.99:     129.0 ms
     Max:     132.6 ms

When running on e.g. a 8 core machine, having the option to start 'wsperf` like this would be ideal:

 wsperf --workers 0,1,2,3 ...

This would then allow to start the testee

testee --workers 4,5,6,7 ...

With Python, there is the psutil package, which relies on the sched_setaffinity system call on Linux.

The feature (setting thread/process CPU affinity) should be available on other platforms as well.

oberstet avatar Nov 02 '13 18:11 oberstet