On 17/02/2006, at 05:02, John Hampton wrote:

Brad Anderson wrote:
We have 70 projects, but only about 25 are active and using Trac. And indeed, on an Apache restart, everything is fine, but it takes a while to clean up the
Apache threads and the idle connections.

I wonder if this is because mod_python can't reuse the connection to different databases. I have been using PostgreSQL and haven't experienced this problem yet. However, I am using my schema patch so that all my trac sites are in one database but separate schemas.

The way mod_python is designed the database connections aren't able to be shared between different Apache processes, and I think that with separate databases per environment a new database connection is required. A short-term workaround could be to run Trac using FastCGI and a fixed number of listener processes. This would allow you to limit the number of database connections to (number of environments * number of FastCGI processes) rather than (number of environments * number of Apache processes). I usually find that 3 or 4 FastCGI listeners will suffice for a moderately busy Trac install, and that would definitely cut down the number of database connections from the typical 5 or 10 Apache processes that may be running at one time.

I'm unsure how the general problem could be better solved for mod_python, as the issue seems to be primarily due to the forking nature of Apache.

Kind regards,

Mark Rowe
<http://bdash.net.nz/>
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

Reply via email to