On 19.01.2018 19:28, Pavel Stehule wrote:
Sorry, I do not understand your point.
In my case pgbench establish connection to the pgbouncer only once at the beginning of the test.
And pgbouncer spends all time in context switches (CPU usage is 100% and it is mostly in kernel space: top of profile are kernel functions).
The same picture will be if instead of pgbouncer you will do such scheduling in one bgworker.
For the modern systems are not able to perform more than several hundreds of connection switches per second.
So with single multiplexing thread or process you can not get speed more than 100k, while at powerful NUMA system it is possible to achieve millions of TPS.
It is illustrated by the results I have sent in the previous mail: by spawning 10 instances of pgbouncer I was able to receive 7 times bigger speed.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company