تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
8 الردود
15204 أدوات العرض

Odoo does not close idle postgresql processes by default. Is there a way to close idle postgres processes (without restarting odoo service)?

الصورة الرمزية
إهمال
أفضل إجابة

You could do it using pg_bouncer as connection pooling in front of your postgresql database and config odoo to connect to it. Pg_bouncer could close the idle transactions for you by setting a timeout for the idle connections that it's managed. Also it could increase your connections number for Odoo and others postgresql consumers by a really big number difference in compared with the real postgresql connections

الصورة الرمزية
إهمال
الكاتب

Thanks, I'm currently testing it. Has pgbouncer any performance impact on Odoo?

normally an improvement of Odoo performance because of the pg_bouncer connection pooling. I use transaction timeout to close the idle queries. The only thing could be when you are using pg_bouncer to pool all your database and you try to create a new database through pg_bouncer, that is not working completely in my setup

الكاتب

It seems to work, after around 10 minutes the idle processes are gone.

الكاتب

I can create a new database without problems.

Could you share your pg_bouncer config that allow you to create and proxy new databases?. It have been a while since I mount it and maybe I just dont config something needed for that

الكاتب أفضل إجابة

[databases]

* = port=5432

[pgbouncer]

logfile = /var/log/postgresql/pgbouncer.log

pidfile = /var/log/postgresql/pgbouncer.pid

listen_addr = *

listen_port = 6432

unix_socket_dir = /var/run/postgresql

auth_type = trust

auth_file = /etc/pgbouncer/userlist.txt

admin_users = postgres

stats_users = postgres

pool_mode = transaction

server_reset_query = DISCARD ALL;

server_check_query = select 1

server_check_delay = 10

max_client_conn = 1000

default_pool_size = 20

log_connections = 1

log_disconnections = 1

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
فبراير 24
5404
0
فبراير 21
1928
2
أكتوبر 23
2048
1
يونيو 23
5583
1
يناير 23
2526