Start writing here...
🧠 Why this module exists
By now you know that:
Odoo collapses without connection control
PostgreSQL does not scale with hundreds of processes
PgBouncer is the missing piece
But here comes the problem:
Most guides explain PgBouncer generically, not for Odoo.
And PgBouncermisunderstoodis PgBouncermisconfigured.
🚫 What we are NOT going to do here
We are not going to:
explain PostgreSQL from scratch
repeat official documentation
talk about all the parameters
sell PgBouncer as magic
👉 We are going to explainonly what Odoo needs.
🔌 What is PgBouncer (Odoo version)
PgBouncer is:
a connection proxy
specialized in PostgreSQL
extremely lightweight
For Odoo it means:
many connections from the app
few real connections to the engine
immediate reuse after each transaction
Architecture:
Odoo → PgBouncer → PostgreSQL
🔄 The key concept: decoupling
PgBouncer separates:
logical connections(Odoo)
fromphysical connections(PostgreSQL)
Odoo thinks it has thousands of connections.
PostgreSQL only sees the ones it can handle.
🧠 Why this is vital for Odoo
Odoo:
uses intensive ORM
opens frequent transactions
holds connections longer than ideal
mixes users, crons, and workers
PgBouncer:
normalizes the chaos
imposes limits
stabilizes the system
⚙️ Pooling: how PgBouncer thinks
PgBouncer works like this:
receives a connection
assigns a real connection
executes the transaction
releases the connection
another client reuses it
👉 The key iswhen it is released.
🧨 This is where many fail
PgBouncer hasseveral pooling modes.
Choosing the wrong one:
breaks Odoo
blocks pools
causes starvation
causes intermittent timeouts
👉 In Odooonly one is correct.
🔗 What’s coming in this module
In the upcoming chapters we cover:
PgBouncer vs direct connections in Odoo
Pool mode: session vs transaction (the critical point)
What PgBouncer does and what it DOES NOT do
Common mistakes when using PgBouncer with Odoo
All with real examples.
🧠 PgBouncer is not an "accelerator"
Important:
it does not make queries faster
it does not cache data
it does not replace PostgreSQL
Its function is:
to prevent PostgreSQL from drowning.
And that, in Odoo, changes everything.
🔗 Key module links
📌 Conclusion
PgBouncer is not complex.
The complex part isusing it incorrectly.
If you understand:
what problem it solves
how it thinks
how it interacts with Odoo
👉 then it becomes predictable, stable, and powerful.
👉 Next chapter:
PgBouncer vs direct connections in Odoo
Next chapter ->