Feat: Add GKE Postgres Benchmarking Support (Sysbench & CNPG HA)#6465
Draft
manojcns wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
Draft
Feat: Add GKE Postgres Benchmarking Support (Sysbench & CNPG HA)#6465manojcns wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
manojcns wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
Conversation
ea5c716 to
638eb20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces benchmarking capabilities for PostgreSQL on Google Kubernetes Engine (GKE), adding support for both standalone and High Availability (HA) topologies. It specifically targets newer infrastructure options like C4 machine types and Hyperdisk Balanced storage.
Summary
The contribution adds two new benchmarks:
postgres_sysbench_gke: A standalone benchmark deploying PostgreSQL as a StatefulSet with a Sysbench client pod.postgres_cnpg_benchmark: An HA benchmark leveraging the CloudNativePG (CNPG) operator to deploy a Primary-Replica cluster.These benchmarks allow for rigorous performance testing of GKE storage and networking, including support for advanced configurations like HugePages, Host Networking, and PostgreSQL parameter tuning.
Key Features
New Standalone Benchmark (
postgres_sysbench_gke):v6,v1+v6+v4) that automatically tuneshared_buffers,effective_io_concurrency, and kernel limits.New HA Benchmark (
postgres_cnpg_benchmark):hostnetworkprofile.Infrastructure Intelligence:
C4->hyperdisk-balanced,N2->pd-ssd).Code Structure & Implementation Details
-- New Files(Benchmarks & Logic)
-- New Files (Kubernetes Templates & Manifests)
-- New Files (Documentation)
-- Modified Files
[perfkitbenchmarker/resources/container_service/kubernetes_cluster.py]:
* Restored: Added back ApplyManifest and WaitForResource methods to KubernetesCluster for backward compatibility.
* Robustness: Increased PVC deletion timeout to 15 minutes (was 5m) to fix teardown flakes with large disks.
[perfkitbenchmarker/providers/gcp/google_kubernetes_engine.py]: Minor compatibility updates to support the restored container service methods.
[perfkitbenchmarker/linux_packages/sysbench.py]: (Minor) Updates to Sysbench package installation logic for compatibility with newer Debian/Ubuntu images.
Example Run Command
python3 pkb.py \ --benchmarks=postgres_sysbench_gke \ --cloud=GCP \ --vm_platform=Kubernetes \ --zone=us-central1-a \ --project=$PROJECT_ID \ --postgres_gke_server_machine_type=c4-standard-16 \ --postgres_gke_client_machine_type=c4-standard-16 \ --postgres_gke_client_mode=pod \ --postgres_gke_disk_type=hyperdisk-balanced \ --postgres_gke_disk_size=500 \ --postgres_gke_optimization_profile=v6 \ --sysbench_tables=10 \ --sysbench_table_size=4000000 \ --sysbench_run_threads=512 \ --sysbench_run_seconds=300 \ --sysbench_testname=oltp_read_write \ --metadata=cloud:GCP \ --metadata=geo:us-central1 \ --metadata=scenario:postgres_optimized_v6 \ --metadata=optimization_profile:v6 \ --temp_dir=./pkb_temp \ --run_stage_iterations=1 \ --owner=$(whoami | tr '.' '-') \ --log_level=error \ --accept_licenses