Skip to main content
Performance testing covers two complementary approaches: the load generator, which measures ingest performance against the primary across runs to catch regressions, and perf/pgbench profiling, which captures CPU hotspots in performance-critical components as flame graphs.

Load generator

The load generator script is available in <springtail>/python/performance/load_generator.py It contains a config file <springtail>/python/performance/load_config.yaml The config file looks like below

Configuration sample

Configuration details

Run command

Profiling with perf and pgbench

Performance testing of the system can be done by using tools like perf and pgbench. We use perf to attach to the process whose performance needs to be evaluated. Two performance critical components in the system are proxy (data access) and pg_log_mgr_daemon (for data replication). Here are the instructions for running performance test, collecting perf output, and post-processing it.
  1. Start you test environment. Make sure the system is up, end to end. If you are only interested in looking at performance of the ingestion pipeline, running proxy is not required. It is better to run each part of the service in its own virtual machine so that the performance of different components does not interfere which the performance of the service whose you are trying to evaluate.
  2. Log into the virtual machine of the service and run:
  1. Generate load on the primary database directly or through the proxy:
  • What we basically do here is running 10 database clients in 10 separate threads (one per thread) for 120 seconds. There are other options available for pgbench. All the information is available on this page: pgbench. When running directly against primary database, configure this database host name and port. When running against proxy, configure the host name and port that belong to proxy.
  1. Once pgbench is done, stop the perf record command and post-process the data it collected using the following command:
  1. The output file we created in the previous step needs to be folded. There is a tool that does it:
  1. The output file we produced in the previous step can now be used to view as a flame graph. Go to https://www.speedscope.app/ and drag and drop the file.