mirror of
https://github.com/neondatabase/neon.git
synced 2026-06-02 21:10:38 +00:00
use a prod-like shared_buffers size for some perf unit tests (#11373)
## Problem
In Neon DBaaS we adjust the shared_buffers to the size of the compute,
or better described we adjust the max number of connections to the
compute size and we adjust the shared_buffers size to the number of max
connections according to about the following sizes
`2 CU: 225mb; 4 CU: 450mb; 8 CU: 900mb`
[see](877e33b428/goapp/controlplane/internal/pkg/compute/computespec/pg_settings.go (L405))
## Summary of changes
We should run perf unit tests with settings that is realistic for a
paying customer and select 8 CU as the reference for those tests.
This commit is contained in:
@@ -7,6 +7,8 @@ from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from fixtures.neon_fixtures import Endpoint, NeonEnv
|
||||
|
||||
from fixtures.utils import shared_buffers_for_max_cu
|
||||
|
||||
|
||||
async def repeat_bytes(buf, repetitions: int):
|
||||
for _ in range(repetitions):
|
||||
@@ -45,7 +47,10 @@ async def parallel_load_same_table(endpoint: Endpoint, n_parallel: int):
|
||||
# Load data into one table with COPY TO from 5 parallel connections
|
||||
def test_parallel_copy(neon_simple_env: NeonEnv, n_parallel=5):
|
||||
env = neon_simple_env
|
||||
endpoint = env.endpoints.create_start("main")
|
||||
# use shared_buffers size like in production for 8 CU compute
|
||||
endpoint = env.endpoints.create_start(
|
||||
"main", config_lines=[f"shared_buffers={shared_buffers_for_max_cu(8.0)}"]
|
||||
)
|
||||
|
||||
# Create test table
|
||||
conn = endpoint.connect()
|
||||
|
||||
Reference in New Issue
Block a user