I'm running odoo 10 on a ubuntu 10.04 server with postgresql 9.5 database. Because multiple odoo instances and configured workers I have 300+ idle postgres tasks. This eats up nearly all my RAM. Now I'm trying to install pgbouncer. When I lunch the pgbouncer service the first time it works, but stop/start or just restart fails and so I can't run the pgbouncer.
I've installed it from git and from apt-get. Both times the same. Have googled for two days to try to fix the issue but nothing works.
Can someone explain me the order what you need to do when you install pgbouncer that it works. Do I need to install it before the db?! do I need to stop the odoo, postgres services when I install it?
The way I tried:
sudo apt-get update
sudo apt-get install pgbouncer
# write the users
sodu -u postgres psql
COPY ( SELECT '"' || rolname || '" "' || CASE WHEN rolpassword IS null THEN '' ELSE rolpassword END || '"' FROM pg_authid ) TO '/etc/pgbouncer/userlist.txt';
# sudo nano pgbouncer.ini
[databases] ;* = port=5432 postgres = host=localhost dbname=postgres [pgbouncer] listen_port = 6432 listen_addr = 127.0.0.1 auth_type = md5 auth_file = /etc/pgbouncer/userlist.txt logfile = /var/log/pgbouncer.log pidfile = /var/run/pgbouncer/pgbouncer.pid admin_users = postgres pool_mode = session server_reset_query = DISCARD ALL default_pool_size=56 max_client_conn=1000
# and then change the db_port to 6432 in odoo.conf
when I started the first time it worked... all the other times I get ...fail!
Hope someone can help!