Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Killing idle postgres processes

By
Mario Gielissen | Openworx
on 4/14/16, 3:53 AM 1,243 views

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

0

Axel Mendoza

--Axel Mendoza--
10298
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 4/14/16, 4:22 AM

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?

Mario Gielissen | Openworx
on 4/14/16, 4:50 AM

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

Axel Mendoza
on 4/14/16, 4:54 AM

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

Mario Gielissen | Openworx
on 4/14/16, 5:21 AM

I can create a new database without problems.

Mario Gielissen | Openworx
on 4/14/16, 5:23 AM

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

Axel Mendoza
on 4/14/16, 3:37 PM
0

[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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 4/14/16, 3:53 AM
Seen: 1243 times
Last updated: 5/12/16, 3:21 PM