Skip to content

Enormous performance regression by PR #482 when prepared_statements is set to true #534

Closed
@JelteF

Description

@JelteF

Describe the bug
I wanted to try out prepared statement support and measure its performance in pgcat (essentially reproducing the blog). But when running pgbench --select-only on the main branch I was only able to get ~50 TPS.

To Reproduce
Steps to reproduce the behavior:

  1. git checkout main
  2. Add prepared_statements = true to the minimal config
  3. RUST_LOG=info cargo run --release -- pgcat.minimal.toml
  4. pgbench --select-only -T 10 -P 1 -p 6433 --protocol prepared

Expected behavior
Get somewhere in the order of 2000-20000 TPS. But instead I get between 20-50TPS. The worst part is that this even happens when using --protocol simple. Only if you enable prepared_statements = true from the config, performance of --protocol simple returns to normal levels.

Screenshots
I narrowed the regression down commit: 4b78af9
With commit: 4b78af9
image

With commit right before: 73500c0
image

Desktop (please complete the following information):

  • OS: Linux

Additional info
The reason I was testing pgcat its performance was because I wanted to compare PgBouncer its upcoming prepared statement support (pgbouncer/pgbouncer#845) to pgcat and Odyssey. But pgcat its perf was so much lower than expected that something obviously seemed wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions