NAME

benchmark-perlformance-set-stable-system - CPU scaling utility for Benchmark::Perl::Formance

SYNOPSIS

Usage:

  $ bin/benchmark-perlformance-set-stable-system list
  $ bin/benchmark-perlformance-set-stable-system lo      > ORIG_VALUES_FILE
  $ bin/benchmark-perlformance-set-stable-system hi      > ORIG_VALUES_FILE
  $ bin/benchmark-perlformance-set-stable-system restore < ORIG_VALUES_FILE

It needs root permissions to actually change the cpu settings, so run it with sudo.

ABOUT

This is an utility to be used from inside benchmark-perlformance in order to prepare a system as stable as possible, but can also be used on its own.

Tries to stabilize a system via:

  • Setting max frequency of all cpus to the minimal possible cpu frequency (so the system can't scale down further unexpectedly, e.g. when it gets hot).

  • Disabling address space randomization (ASLR) (https://wiki.ubuntu.com/Security/Features)

  • Drop caches (http://linux-mm.org/Drop_Caches)

  • Classical disk sync

COMMANDS

  • list

    Prints the current values to STDOUT, in a format readable by the reset command.

  • lo

    Scales down a system to lowest possible frequency, disables ASLR, flushes caches, calls 'sync'.

    Prints the original values to STDOUT, in a format readable by the reset command.

  • hi

    This tries to be the complement to lo.

    Scales up the system to highest possible frequency (but enables ASLR again which is not really a fast setting).

    Prints the original values to STDOUT, in a format readable by the reset command.

    This isn't recommended for getting stable benchmark values because a scaled-up system might be forced to scale down automatically by the cpu when it gets too hot, or scale up to turbo mode.

  • restore

    Restores the original values, as read from STDIN in a format as produced by the other commands.

FUNCTIONS

proc_value

Get or set value in /proc or /sys filesystem.

set($hi)

Set the requested stabilization mode. If parameter $hi is true then it sets the max allowed frequency to the maximum (command hi), otherwise to the lowest possible value (command lo).

This sub prints out the original values to STDOUT via Data::Dumper, like it is expected by the restore command.

reset

Resets the cpu stabilization to the original values.

It reads these values from STDIN as Data::Dumper format like provided by the set() function.

usage

Prints out usage help text.

main

The main function. Reads arguments and calls respective functions.

AUTHOR

Steffen Schwigon <ss5@renormalist.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Steffen Schwigon.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.