Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Odoo and pgcat pooler with Multi-threaded runtime

Subscribe

Get notified when there's activity on this post

This question has been flagged
postgresqlpoolpooleLoadBalancerloadbalancer
1 Reply
5730 Views
Avatar
Edgar Ortigoza

Hello, do someone has already installed odoo with pgcat ?

the repository is on github  postgresml/pgcat

Pgcat is a PostgreSQL pooler and proxy (like pgbouncer) with support for sharding, load balancing, failover and mirroring, with  Multi-threaded runtime

The big benefit of PgCat is multi-threaded. If you use pgbouncer at scale, you very likely have run into the problem that pgbouncer is ultimately a single-threaded asynchronous connection based pooler.

It is pretty good at handling a lot of connections, but if you have a lot of activities for individual connections, that's where you'll run into bottlenecks.  PgCat don't have this issue.


I have tried it with success (work very well), my config is in the comment below.

The dev version usually has some errors with odoo, the version that currently works for me is 1.1.1 and 1.1.0



some features

FeatureStatusComments
Transaction poolingStableIdentical to PgBouncer with notable improvements for handling bad clients and abandoned transactions.
Session poolingStableIdentical to PgBouncer.
Multi-threaded runtimeStableUsing Tokio asynchronous runtime, the pooler takes advantage of multicore machines.
Load balancing of read queriesStableQueries are automatically load balanced between replicas and the primary.
FailoverStableQueries are automatically rerouted around broken replicas, validated by regular health checks.
Admin database statisticsStablePooler statistics and administration via the pgbouncer and pgcat databases.
Prometheus statisticsStableStatistics are reported via a HTTP endpoint for Prometheus.
SSL/TLSStableClients can connect to the pooler using TLS. Pooler can connect to Postgres servers using TLS.
Client/Server authenticationStableClients can connect using MD5 authentication, supported by libpq and all Postgres client drivers. PgCat can connect to Postgres using MD5 and SCRAM-SHA-256.
Live configuration reloadingStableIdentical to PgBouncer; all settings can be reloaded dynamically (except host and port).
Auth passthroughStableMD5 password authentication can be configured to use an auth_query so no cleartext passwords are needed in the config file.
Sharding using extended SQL syntaxExperimentalClients can dynamically configure the pooler to route queries to specific shards.
Sharding using comments parsing/RegexExperimentalClients can include shard information (sharding key, shard ID) in the query comments.
Automatic shardingExperimentalPgCat can parse queries, detect sharding keys automatically, and route queries to the correct shard.
MirroringExperimentalMirror queries between multiple databases in order to test servers with realistic production traffic.


0
Avatar
Discard
Edgar Ortigoza
Author

THIS CONFIG WORK FOR ME with docker container pgcat 1.1.1 and postgres installed in the host
# in postgresql.conf use
listen_addresses = '*'
# and in pg_hba.conf
host all all 172.19.0.0/16 md5

#################################################
[general]

host = "172.19.0.250" # or "0.0.0.0" ip for client login
port = 6431 # port for client login

worker_threads = 10
autoreload = 15000
server_tls = false
verify_server_certificate = false
#statement_timeout = 0
idle_client_in_transaction_timeout = 0 # milliseconds
# How long to wait before aborting a server connection (ms).
connect_timeout = 5000 # milliseconds
# How long an idle connection with a server is left open (ms).
idle_timeout = 30000 # milliseconds

# Admin like postgres
admin_username = "odoo"
admin_password = "SecurePasswd"

[pools.odoo.users.1] # [pools.database.users.(user_index)] this case is user 1
username = "odoo"
password = "SecurePasswd"
pool_size = 100
pool_mode = "transaction"
[pools.odoo.shards.0] # [pools.database.shards.(shard_id)] this case I use 0 for my localhost
servers = [
["172.19.0.1", 5432, "primary"]]
database = "odoo"

[pools.database1.users.1] # user 1
username = "odoo"
password = "SecurePasswd"
pool_size = 100
pool_mode = "transaction"
[pools.database1.shards.0]
servers = [
["172.19.0.1", 5432, "primary"]]
database = "database1"

[pools.database2.users.2] # for user 2
username = "user2"
password = "SecurePasswd"
pool_size = 100
pool_mode = "transaction"
[pools.database2.shards.0] # id for localhost
servers = [
["172.19.0.1", 5432, "primary"]]
database = "database2"

[pools.database3.users.2] # user 2
username = "user2"
password = "SecurePasswd"
pool_size = 100
pool_mode = "transaction"
[pools.database3.shards.0]
servers = [
["172.19.0.1", 5432, "primary"]]
database = "database3"

[pools.database4.users.3] # user 3
username = "user3"
password = "SecurePasswd"
pool_size = 100
pool_mode = "transaction"
[pools.database4.shards.0]
servers = [
["172.19.0.1", 5432, "primary"]]
database = "database4"
###################################################

Edgar Ortigoza
Author

New version of pgcat 1.2.0 work nice
my config
THIS CONFIG WORK FOR ME pgcat 1.2.0 in the host and postgres installed in the host
# in postgresql.conf use
listen_addresses = '127.0.0.1'
# and in pg_hba.conf
host all all 127.0.0.1/32 md5

for docker
host = "172.19.0.1" # custom docker network ip for client login
port = 8431 # port for client login

Avatar
Edgar Ortigoza
Author Best Answer
  1. Install Rust (latest stable will work great)
  2. cargo build --release  
  3. Change the config in pgcat.toml to fit your setup 
  4. #################################################

[general]


host = "172.19.0.250" # this is custom network for docker or "172.19.0.1" ip pgcat instaled in the host

port = 6431 # custom port for client login

worker_threads = 10

autoreload = 15000

server_tls = false

verify_server_certificate = false

#statement_timeout = 0

idle_client_in_transaction_timeout = 0 # milliseconds

# How long to wait before aborting a server connection (ms).

connect_timeout = 5000 # milliseconds

# How long an idle connection with a server is left open (ms).

idle_timeout = 30000 # milliseconds

# Admin like postgres

admin_username = "postgres"   # or other user with superuser role

admin_password = "SecurePasswd"



[pools.odoo.users.1] # [pools.database.users.(user_index)] this case is user 1

username = "odoo"

password = "SecurePasswd"

pool_size = 100

pool_mode = "transaction"

[pools.odoo.shards.0] # [pools.database.shards.(shard_id)] this case I use 0 for my localhost

servers = [

["127.0.0.1", 5432, "primary"]]

database = "odoo"



[pools.database1.users.1] # user 1

username = "odoo"

password = "SecurePasswd"

pool_size = 100

pool_mode = "transaction"

[pools.database1.shards.0]

servers = [

["127.0.0.1", 5432, "primary"]]

database = "database1"



[pools.database2.users.2] # for user 2

username = "user2"

password = "SecurePasswd"

pool_size = 100

pool_mode = "transaction"

[pools.database2.shards.0] # id for localhost

servers = [

["127.0.0.1", 5432, "primary"]]

database = "database2"



[pools.database3.users.2] # user 2

username = "user2"

password = "SecurePasswd"

pool_size = 100

pool_mode = "transaction"

[pools.database3.shards.0]

servers = [

["127.0.0.1", 5432, "primary"]]

database = "database3"



[pools.database4.users.3] # user 3

username = "user3"

password = "SecurePasswd"

pool_size = 100

pool_mode = "transaction"

[pools.database4.shards.0]

servers = [

["127.0.0.1", 5432, "primary"]]

database = "database4"


###################################################



New version of pgcat 1.2.0 work nice

my config with pgcat installed in the host with postgres in the host

# in postgresql.conf use

listen_addresses = '127.0.0.1'

# and in pg_hba.conf

host all all 127.0.0.1/32 md5

for docker

host = "172.19.0.1" # custom docker network ip for client login

port = 8431 # port for client login

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
When Odoo 14 connects to PostgreSQL 15.7, the connection is idle but cannot be released
postgresql
Avatar
0
Feb 25
3031
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied
postgresql
Avatar
Avatar
Avatar
2
Jan 25
10370
Odoo backend to Google Data Studio Solved
postgresql
Avatar
Avatar
2
Jan 24
10140
Reason why Odoo being slow when there is huge data inside the database
postgresql
Avatar
Avatar
Avatar
Avatar
7
Jan 24
51246
Postgresql db connection failing often and causing http 500 error Odoo v11
postgresql
Avatar
0
Mar 23
2999
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now