Re[2]: [HACKERS] 9.4 -> 9.5 regression with queries through pgbouncer on RHEL 6

From: Dmitriy Sarafannikov <d(dot)sarafannikov(at)bk(dot)ru>
To: root(at)simply(dot)name
Cc: andres(at)anarazel(dot)de, pgsql-hackers(at)postgresql(dot)org, pgbouncer-general(at)lists(dot)pgfoundry(dot)org
Subject: Re[2]: [HACKERS] 9.4 -> 9.5 regression with queries through pgbouncer on RHEL 6
Date: 2016-07-14 13:06:13
Message-ID: 1468501573.373113086@f434.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>The results above are not really fair, pgbouncer.ini was a bit different on Ubuntu host (application_name_add_host was disabled). Here are the right results with exactly the same configuration:
>>
>>OS PostgreSQL version TPS Avg. latency
>>RHEL 6 9.4 44898 1.425 ms
>>RHEL 6 9.5 26199 2.443 ms
>>RHEL 6 9.5 43027 1.487 ms
>>Ubuntu 14.04 9.4 45971 1.392 ms
>>Ubuntu 14.04 9.5 40282 1.589 ms
>>Ubuntu 14.04 9.6 45410 1.409 ms
>>
>>It can be seen that there is a regression for 9.5 in Ubuntu also, but not so significant. We first thought that the reason is 38628db8d8caff21eb6cf8d775c0b2d04cf07b9b (Add memory barriers for   PgBackendStatus.st _changecount protocol), but in that case the regression should also be seen in 9.6 also.
>>
>>There also was a bunch of changes in FE/BE communication (like 387da18874afa17156ee3af63766f17efb53c4b9 or 98a64d0bd713cb89e61bef6432befc4b7b5da59e) and that may answer the question of regression in 9.5 and normal results in 9.6. Probably the right way to find the answer is to do bisect. I’ll do it but if some more diagnostics information can help, feel free to ask about it.
>
>Yep, bisect confirms that the first bad commit in REL9_5_STABLE is 387da18874afa17156ee3af63766f17efb53c4b9. Full output is attached.
>And bisect for master branch confirms that the situation became much better after 98a64d0bd713cb89e61bef6432befc4b7b5da59e. Output is also attached.
>
>On Ubuntu performance degradation is ~15% and on RHEL it is ~100%. I don’t know what is the cause for different numbers on RHEL and Ubuntu but certainly there is a regression when pgbouncer is connected to postgres through localhost. When I try to connect pgbouncer to postgres through unix-socket performance is constantly bad on all postgres versions.
>
>Both servers are for testing but I can easily provide you SSH access only to Ubuntu host if necessary. I can also gather more diagnostics if needed.

We have not invented anything better than to backport 98a64d0bd713cb89e61bef6432befc4b7b5da59e from 9.6 to 9.5.
It completely solved the problem. If anyone is interested or anyone will face with this problem, patch is attached.

Regards,
Dmitriy Sarafannikov

Attachment Content-Type Size
postgres_epoll.patch application/x-patch 50.8 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Madusudanan.B.N 2016-07-14 13:16:22 Unable to test parallel aggregate/joins in Postgres beta 2
Previous Message Amit Kapila 2016-07-14 12:42:42 Re: Reviewing freeze map code