Release of cache-bench 0.1.0 to investigate the effectiveness of file caching under low memory conditions

cache-bench is a Python script that allows you to evaluate the impact of virtual memory settings (vm.swappiness, vm.watermark_scale_factor, Multigenerational LRU Framework, and others) on the performance of tasks that depend on caching file reads under low memory conditions. The code is open under the CC0 license.

The main usage is to read files from a specified directory in random order and add them to a list until a given number of mebibytes has been read. Two operating modes are available:

  • The first - auxiliary - is used to create a directory of a given size. At the same time, a certain number of mebibyte files with random names are created in the directory.
  • The second mode - the main one - is the mode of reading files from the specified directory in random order. During reading, the amount of memory consumed by the script grows, and the speed of reading a given amount of files depends on the amount of cached file pages.

Also part of the project is the drop-cache helper script, which is recommended to run before starting the test. While the script is running in read mode, the total time of work, the average reading speed, and the name of the last read file are displayed. The script also allows you to log the results to a file with timestamps.

Source: opennet.ru

Add a comment