~/talk

A Deep Dive into the DB Connection Pool

Talkat GopherCon Europe 2024 · 2024-06-17..06-20· [go, databases]
slides:none on file

Mattermost moves from one database per customer to multi-schema sharing via Postgres schemas and PG bouncer but hits a hotspot: three per-customer pools (each size 20) create ~60 client pools contending for 20 outgoing connections, causing frequent connect/disconnect and CPU spikes. A custom proxy Perseus (github com/mattermost/perseus) is built that stores a client schema, sets search_path on checkout, and implements a pool with an idle connection slice, request queue, and a connection reaper; it proves the idea but is discarded for a security risk.

AI-written summary · about

  1. 0:00Introduction
  2. 1:26Mattermost cloud scalability
  3. 3:12Multi-tenancy with PostgreSQL
  4. 5:38Connection pooling problems
  5. 7:48Introducing Persus pool
  6. 9:14How pools work internally
  7. 11:24Deployment and security
  8. 12:48Key takeaways and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.