Odoo Help

3

2
4 Answers
6
YannickB
1/17/15, 10:45 AM

Credit to @panos_xrg and @reis_pt for pointing me in the good direction https://twitter.com/panos_xrg/status/556460140149633026 https://twitter.com/reis_pt/status/556456989170339841

It seems it's the official strategy of Odoo to keep connection to postgres open, at least if what was said in this very old thread https://bugs.launchpad.net/openobject-server/+bug/463219 is still true.

I have a dozen of odoo services connected to the same postgres, each having five database to manage with 4 workers. I still can't found how many connections are opened for each services/database/workers and under which conditions but it doesn't seems to be really controled and it finally reach the 100 connections which is the limit of my postgres configuration.

In the F3 fork @panos_xrg decided to automatically close all connections older that 300seconds https://github.com/xrg/openerp-server/commit/b215015ba0453a. After playing a little with the odoo config, I found that there is a way to achieve the same thing which the official Odoo, it's the db_maxconn parameter.
When the number of opened connection in an odoo service reach the db_maxconn limit, it's seems the oldest connections are automatically closed. Looks like the way to go for me, and I guess that the rules are :

-The sum of all db_maxconn settings for each odoo services connected to the same postgres shall be less that this postgres maxconn configuration.

-The db_maxconn settings for an odoo service shall be high enough to manage the concurrent requests on this service.

So I'll try to set a db_maxconn settings to 10 on each of my odoo services, and I hope this will resolve the problem. I guess this is an important information to have in mind when you want like me to make many odoo services connected to same postgres, and not one big odoo service connected to one postgres (like Odoo SA if I'm not mistaking) nor several odoo services having each their own postgres (like most of the other odoo hosting).

1 Comment
Olivier Dony (odo)
1/19/15, 5:39 AM

Yes using the db_maxconn to this purpose is correct, and your can do the maths when you need to determine the max_connections settings for your PG cluster according to the number of Odoo processes/workers that will connect to it and their db_maxconn setting (keeping in mind that the db_maxconn setting applies *per-process*, so with `--workers` > 1, each worker can have up to db_maxconn open connections.

-1
Patrick Aymar
2/3/15, 4:45 AM

" ... each worker can have up to db_maxconn open connections."

Then is there a setting or a way to limit the absolut number of processes ?

Edit : Ok I finally get what this worker stuff is about, learning, learning ...

Ask a Question
Writer
Keep Informed
8 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now