Skip to Content
Menu
This question has been flagged

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.


Avatar
Discard
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"
###################################################

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

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

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 25
494
2
Jan 25
6116
2
Jan 24
10137
7
Jan 24
47216
0
Mar 23
1464