Skip to main content

Usage

Running a Script​

The image has no default command. Pass one script as the command; the scripts are in /usr/local/bin, which is on PATH:

docker run --rm --privileged ghcr.io/sparecores/benchmark:main openssl.sh
docker run --rm --privileged ghcr.io/sparecores/benchmark:main bw_mem.sh
docker run --rm --privileged ghcr.io/sparecores/benchmark:main python /usr/local/bin/compress.py
docker run --rm --privileged ghcr.io/sparecores/benchmark:main geekbench.sh

The scripts take no arguments; all benchmark settings are fixed in the scripts. Each script has its own page, with what it runs and what it prints:

The container entrypointcontainer entrypointThe executable that a container image runs when a container starts, set by the ENTRYPOINT instruction of its Dockerfile. The image's default command (CMD), or the arguments given after the image name in docker run, are passed to it as arguments, so an entrypoint can wrap any command, for example to set up the environment or record resource usage first. The docker run --entrypoint option replaces it.Dockerfile referenceGlossary runs every command under Resource Tracker (resource-trackerresource-trackerAn open-source Spare Cores tool that runs a command and samples resource usage while it runs, such as CPU, memory, disk, network, GPU, and GPU memory use. It can optionally stream the samples to the Spare Cores Sentinel platform, so that a run can be checked to see its aggregated and detailed resource utilization, e.g., whether it used all CPU or GPU cores as intended while running a Navigator benchmark workload.resource-tracker on GitHubGlossary), which samples the container's resource usage. Its metrics are not published.

Production Setup​

The Inspector of Spare Cores Navigator runs each script as a separate task. A plain docker run differs from it as noted below.

Container Settings​

All four tasks run privileged with host networking, and each has a 1 hour timeout. Production runs compress.py and geekbench.sh under nice -n -20niceA Unix command that runs a program with a changed scheduling priority, from -20 (highest) to 19 (lowest). Raising a process's priority above the default needs the CAP_SYS_NICE capability, which root has.man pageGlossary from its own command line; openssl.sh and bw_mem.sh set it themselves. A plain docker run without --privileged cannot raise the priority.

The geekbench task also sets the following:

  • a memory limit, including swap, of 85% of available memory
  • swappinessswappinessA Linux kernel setting, vm.swappiness, that sets how readily the kernel swaps out process memory compared with dropping cached file data when it needs free memory. Higher values swap more eagerly; 0 makes the kernel avoid swapping as long as it can. Container runtimes such as Docker can also set it per container.Linux kernel docsGlossary 0

Server Coverage​

Production runs every task on every server type except the following:

  • geekbench: servers with more than 32 vCPUsvCPU: virtual CPUA CPU of a virtual machine, the unit in which cloud vendors sell compute. It is usually one hardware thread of a physical core with SMT, so two vCPUs may share one physical core.WikipediaGlossary or less than 2.1 GiB of memory
  • compression_text (compress.py): servers with less than 1 GiB of memory
  • bw_membw_memThe memory bandwidth tool of LMbench. It moves data through a buffer of a given size in one of several modes, such as rd (read and sum an array), wr (write a constant to each element), rdwr (read, then write the same location), and the copy modes cp, fcp, and bcopy. It reports the buffer size in MB and the bandwidth in MB/s; with -P, it runs several processes, each with its own buffer, and reports their total bandwidth.`bw_mem` manualGlossary: the OVH a10-180 and l4-360 server types, where it crashes or hangs

The image enforces none of these limits.

Run Duration​

The median production run, across ~3400-3800 runs per task, takes the following time:

ScriptProduction taskMedian duration (minutes)
openssl.shopenssl~3.8
bw_mem.shbw_mem~4.0
geekbench.shgeekbench~5.8
compress.pycompression_text~10.7

Environment Variables​

VariableMeaningDefault
BENCHMARK_SECRETS_PASSPHRASEPassphrase that decrypts the GeekbenchGeekbenchA cross-platform CPU and GPU compute benchmark by Primate Labs. Its CPU benchmark runs workloads modeled on real applications, such as file compression, image processing, and web browsing, first on one core and then on all cores, and reports a Single-Core and a Multi-Core score. Geekbench 6 scores are calibrated so that a baseline system scores 2500.GeekbenchGlossary license shipped in the image. Optional: without it, Geekbench runs without a license.Unset
TRACKER_QUIETQuiet mode for Resource Tracker.true