His problem is NOT 'idle in transaction' per se. It is all connections are used up.
Hence the need for pg_bouncer for connection pooling.
Whether pg_bouncer provides a viable solution is just as big an unknown as whether "idle in transaction" is the biggest contributor to the problem. If all of them are idle in transaction then pg_bouncer is powerless to help. If they are generally just long-lived sessions and only a few stay in transaction then transaction pooling mode may help.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.