3

I have a server with multiple cores that is supposed to run pgBouncer (1.7).

It's working pretty well, but it utilises only one CPU core. I get pretty high latency values when I do a load test with pgbench, emulating several clients (27 ms without pgBouncer, and 62 ms with pgBouncer).

How can I make pgBouncer use all available CPU cores?

  • As my understand from your question: suppose that your server has 8 physical CPUs. But it uses only 1 physical CPU for pgBouncer when pgBench, right ? If the answer is yes, how can you know pgBouncer uses only 1 CPU ? (because there are a lot of running process when pgBench) – Luan Huynh Sep 14 '16 at 4:33
  • i started pgbench on another Server. The Server running pgbouncer runs nothing else than pgbouncer. i assume that pgbouncer is using only one cpu because htop showed only one cpu at 100% the others at maximum 1%. – RootOfProblem Sep 14 '16 at 9:13
3

Pgbouncer implementation is based on epoll system call and runs one thread only. You pretty much have to run several pgbouncer processes to utilize more cores(one process per core). But it is what you want to do only when pgbouncer is a bottleneck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.