Add Postgresql with PGBench workload (#3)
- pg init
- realtime run and load output
- few more pg conf settings and PG_INITDB_OPTIONS
- PR feedback
Authored-by: Salvatore Dipietro dipiets@amazon.it
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Repro Collection
A light framework for, and a loose collection of tests, workloads, and repro packages, to aid with community discussions around detecting regressions.
1. Introduction
1.1 Goals
1.2 What The Repro Framework DOESN’T Do
A notable limitation is that the Repro Framework does not fully handle reboot workflow; for example, if a kernel update and subsequent reboot are required, this must be managed externally of the Repro Framework, as it does not include a mechanism to reboot and then automatically continue where it left off. It does, however, support continuing repro execution where it left off before a reboot (or other stopping conditions).
1.3 Assumptions
The Repro Framework aims to automate exactly what you would manually run given pre-configured SUT/LDG machines, and nothing more. In other words: all machines involved in running repros are assumed to be “throw-away” test grade. No effort is made to secure, conceal, verify, or otherwise harden data, communications, or APIs.
In particular, this means:
Root access and Internet access: The Repro Framework itself requires neither. However, as part of the install/configure steps, workloads are likely to attempt to download and install dependency packages, tweak system properties, edit system wide files, create test users, etc. When this is performed, the only mechanism employed (and recommended) is
sudo, which is assumed to be available and correctly preconfigured for the user running the repro or workload.Dependencies: The Repro Framework is designed to be minimalistic as a framework in regards to dependencies. It runs on
bash v5and only needs a few common commands such assedorcat. The complete list of commands can be seen by runningREPROCFG_LOGLEVEL=DEBUG run.sh --help.1.4 Structure
The repository consists of workloads identified with a unique name (each placed in an eponymous directory under
workloads/), repro scenarios (all placed underrepros/), framework files (placed undercommon/), and standalone utilities (placed underutil/).1.5 Glossary
workload- A distinct building block which tests and measures one or more metrics such as throughput performance. It can be run individually or as part of a repro scenario. The use of synthetic benchmarks as workloads is strongly discouraged, as they do not usually represent real life performance correctly.repro- Reproduction scenario. The application of one or more workloads for a particular use case. Repros are used to support claims like “X workload has a regression under Y conditions”.SUT- System Under Test. This is the machine/instance/VM which is measured (tested).LDG- Load Generator. The machine which generates workload data for the SUT. Some workloads only run locally, not requiring a load generator.SUP- Support. This is an additional machine class used by more complex workloads, e.g. for coordinating multiple LDGs.2. How To Run
Running a simple SUT-only workload can be as simple as
run.sh workload_name SUT.Runtime parameters are configured via environment variables which can be modified before running
run.sh. For convenience, a few parameters (--dry-run,--sut=,--loadgen=,--support=) are also available via command line arguments.Available parameters and other helpful information are given when running
run.sh [<workload_name>] --help.For a more complete example, we will illustrate running a
mysqltest below.2.1 Prepare
Set up an arbitrary
SUTand a correspondingLDG, each running e.g. Ubuntu 22.04, with the default user having unrestrictedsudoaccess.Make sure the
LDGcan reach theSUT‘s ports3306(mysql) and31337(the Repro Framework’s communication channel; this is configurable by modifyingREPROCFG_PORTbefore running).The
LDGshould be sized appropriately to not be a bottleneck in any part of the workload (data generation, networking, processing, etc) - otherwise, the measured results will be invalid in the context of theSUT.A RAID0 array is highly recommended for the
mysqldatabase; the workload will attempt to find available disks on the SUT, create a RAID0 array, and mount it for you. If an available (not mounted) RAID0 array already exists, it will be used instead.Clone the
repro-collectionrepository on both theSUTandLDG. In this example, we’ll assume the path to the repository is~/repro-collectionon both machines.2.2 Run
Note: It is good practice to use a terminal abstraction layer such as
screen,tmux, ornohup, so that the workload can continue running without interruption when your network connection to theSUT/LDGexperiences disconnections.On the SUT, run:
~/repro-collection/run.sh mysql SUT --ldg=<ldg_address> 2>&1 | tee ~/sut.log- this will install and start themysqlservice, and wait for the LDG to signal when testing is finished.On the LDG, run:
~/repro-collection/run.sh mysql LDG --sut=<sut_address> 2>&1 | tee ~/ldg.log- this will install and run theHammerDBload generator, produce and export the results when finished, and initiate cleanup both on itself and on the SUT.Done!
Notes:
LDGaddress the same way it will be visible on theSUT. For example, if the LDG has a private network IP address and a second IP address to access the Internet, specify the IP address that theSUTwill receive when connected to. Otherwise, you will getmysqlerrors about unauthorized user connections. If in doubt, you can supply all addresses by using multiple--ldg=arguments.LDGorSUTfirst) does not matter. The machines will wait for each other at the correct times to synchronize the workflow.--sut=and the--ldg=parameters can be specified on theSUTand theLDG; while a longer command line, providing both parameters on both sides is harmless, more consistent and thus less prone to error.LDG. These can be supplied by repeating the--ldg=argument as many times as needed.install/configure/run/results/cleanup. Command line overrides are suported (see the output ofrun.sh --helpfor details).Results
The
mysqlworkload will automatically parse the HammerDB output and create a~/results.jsonfile on theLDG, containing the test conclusion (NOPM and TPM numbers, along with measured latency). It will also print a message like “Test score: NNNN”.An
mysqlresults file might look like this:Repro Scenarios
Repros are an extension of the workload concept, and provide a way to express specific use cases by including sequencing, additional configurations, or even interactions between multiple workloads.
All repro scenarios are under the
repros/directory. Any associated files must be placed in a subdirectory with the same name as the repro scenario.How To Extend
To find out how to contribute a workload or a repro scenario, please refer to the Developer Guide.
License
This project is licensed under the Apache-2.0 License. See LICENSE for more information.