From cfd78950e214cac13823a92319d18dbbb920ea6a Mon Sep 17 00:00:00 2001 From: Arseny Sher Date: Tue, 30 Jan 2024 14:22:21 +0300 Subject: [PATCH] basic sk bench of pgbench init with perf fixtures --- test_runner/fixtures/compare_fixtures.py | 7 +++++-- test_runner/performance/test_perf_pgbench.py | 12 +++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test_runner/fixtures/compare_fixtures.py b/test_runner/fixtures/compare_fixtures.py index 6fbaa08512..f2e84fb8fd 100644 --- a/test_runner/fixtures/compare_fixtures.py +++ b/test_runner/fixtures/compare_fixtures.py @@ -117,7 +117,10 @@ class NeonCompare(PgCompare): self.timeline = self.env.neon_cli.create_timeline(branch_name, tenant_id=self.tenant) # Start pg - self._pg = self.env.endpoints.create_start(branch_name, "main", self.tenant) + config_lines = ["max_replication_write_lag=-1", "max_replication_flush_lag=-1"] + self._pg = self.env.endpoints.create_start( + branch_name, "main", self.tenant, config_lines=config_lines + ) @property def pg(self) -> PgProtocol: @@ -294,7 +297,7 @@ def remote_compare(zenbenchmark: NeonBenchmarker, remote_pg: RemotePostgres) -> return RemoteCompare(zenbenchmark, remote_pg) -@pytest.fixture(params=["vanilla_compare", "neon_compare"], ids=["vanilla", "neon"]) +@pytest.fixture(params=["neon_compare"], ids=["neon"]) def neon_with_baseline(request: FixtureRequest) -> PgCompare: """Parameterized fixture that helps compare neon against vanilla postgres. diff --git a/test_runner/performance/test_perf_pgbench.py b/test_runner/performance/test_perf_pgbench.py index 2b8760dff2..e4d7b2730b 100644 --- a/test_runner/performance/test_perf_pgbench.py +++ b/test_runner/performance/test_perf_pgbench.py @@ -35,7 +35,7 @@ def init_pgbench(env: PgCompare, cmdline, password: None): t0 = timeit.default_timer() with env.record_pageserver_writes("init.pageserver_writes"): out = env.pg_bin.run_capture(cmdline, env=environ) - env.flush() + # env.flush() duration = timeit.default_timer() - t0 end_timestamp = utc_now_timestamp() @@ -94,9 +94,7 @@ def run_test_pgbench(env: PgCompare, scale: int, duration: int, workload_type: P if workload_type == PgBenchLoadType.INIT: # Run initialize - init_pgbench( - env, ["pgbench", f"-s{scale}", "-i", "-I", "dtGvp", connstr], password=password - ) + init_pgbench(env, ["pgbench", f"-s{scale}", "-i", "-I", "dtG", connstr], password=password) if workload_type == PgBenchLoadType.SIMPLE_UPDATE: # Run simple-update workload @@ -151,7 +149,7 @@ def get_durations_matrix(default: int = 45) -> List[int]: return rv -def get_scales_matrix(default: int = 10) -> List[int]: +def get_scales_matrix(default: int = 100) -> List[int]: scales = os.getenv("TEST_PG_BENCH_SCALES_MATRIX", default=str(default)) rv = [] for s in scales.split(","): @@ -172,8 +170,8 @@ def get_scales_matrix(default: int = 10) -> List[int]: @pytest.mark.parametrize("duration", get_durations_matrix()) def test_pgbench(neon_with_baseline: PgCompare, scale: int, duration: int): run_test_pgbench(neon_with_baseline, scale, duration, PgBenchLoadType.INIT) - run_test_pgbench(neon_with_baseline, scale, duration, PgBenchLoadType.SIMPLE_UPDATE) - run_test_pgbench(neon_with_baseline, scale, duration, PgBenchLoadType.SELECT_ONLY) + # run_test_pgbench(neon_with_baseline, scale, duration, PgBenchLoadType.SIMPLE_UPDATE) + # run_test_pgbench(neon_with_baseline, scale, duration, PgBenchLoadType.SELECT_ONLY) # The following 3 tests run on an existing database as it was set up by previous tests,