[Speed] Linux tip: use isolcpus to have (more) reliable benchmark
alecsandru.patrascu at intel.com
Fri Feb 12 02:42:36 EST 2016
Some of the things we do here at Intel, in our Languages Performance Lab [1,2], is to disable ASLR as you get more reliable results. This can be achieved on Linux by running echo 0 > /proc/sys/kernel/randomize_va_space. Also, setting the CPU frequency at a fixed frequency, disabling Turbo Boost and Hyper Threading, also helps for benchmark stability.
>From my experience, the isolcpus feature is useful when you have a lot of cores on your machine because the kernel will have other cores on which it can schedule its work; furthermore, it is a best effort situation and it is not an absolute guarantee that the kernel will not use the cores specified if you have a lot of processes running (for example, if you benchmark on a machine with 2 physical cores and you isolate one of the cores, there is a big chance that the kernel will schedule processes on this core also, even it is for a small amount of time). Nevertheless, for machines with more physical cores, it can be good to have dedicated core(s) on which we do benchmarking.
> -----Original Message-----
> From: Speed [mailto:speed-
> bounces+alecsandru.patrascu=intel.com at python.org] On Behalf Of Victor
> Sent: Friday, February 12, 2016 12:54 AM
> To: speed at python.org
> Subject: [Speed] Linux tip: use isolcpus to have (more) reliable benchmark
> I'm sharing with you my notes (tricks) to get more reliable benchmarks on
> Linux if your CPU have multiple cores:
> FYI perf.py recently got a new --affinity= optional parameter. I plan to
> send a patch to automatically use /sys/devices/system/cpu/isolated if it's
> not empty.
> What are your "tricks" to get reliable benchmarks?
> Speed mailing list
> Speed at python.org
More information about the Speed