Opened 6 years ago
Last modified 2 months ago
#2176 reopened task
Trac database connections should be pooled
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | SysAdmin/Trac | Keywords: | |
Cc: |
Description
Right after starting PostgreSQL 200 connections get filled by Trac. We want to use some database pooling instead.
Change History (5)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
We could experiment with TRAC_DB_POOL_SIZE env variable (not sure how to set in /etc/apache2/includes/trac_env.inc)
comment:3 by , 6 years ago
was the limit in number of apache processes recently lifted btw ? By TemporSent if I'm not mistaken ? As that'd probably increase the number of connections too (pooling is per-process)
comment:5 by , 2 months ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
I don't think this is a duplicate, trac itself supports pooling and does in fact pool connections, BUT apache starts up to 100 processes (150 by default) and each of them will use its own pool, resulting in an exploding number of connections to the database.
I agree pgbouncer could be one possible solution, but reducing number of apache processes might be another (mod_wsgi ?)
https://trac.edgewall.org/ticket/4347 may be related. Right now I see 21 "idle" connections to the "trac_postgis" database and 124 idle connections in total to trac_X databases