| By Date: | <-- --> |
| By Thread: | <-- --> |
Brad Anderson wrote:
I've isolated some of the data base behavior, I'm not a python programmer (Ruby instead). What I've noticed. When connecting to tracd with Firefox, one connection is established that does not get deleted from pg_stat_activity when the browser is closed. However, when Firefox is opened (only one instance of Firefox is open at any time) tracd uses the connection that the first instance of Firefox had. i.e. NO new connection to the database is established. I can close and reopen that one instance of Firefox and the connections in pg_stat_activity do not increase. Opening a second instance of Firefox and connecting to tracd doesn't increase the connections.Ernest Ellingson wrote: When I open an instance of IE I get 3 connections to the database. (IE uses the maximum of three connections permitted by HTTP 1.1 to query for pieces of each page). When I close the instance of IE the connections remain in pg_stat_activity. I open IE again connect to tracd. The number of connections to the database DO NOT increase. Apparently trac reuses the connections it initially established for IE. I open a second instance of IE on the same machine. The number of connections to the database does NOT increase. I open an instance of IE on another machine. NO new connections to the database. I think the connection pool is adding connections to the database to the pool as the need for connections increases. Releasing a connection doesn't disconnect it from the database but simply returns it to the pool where it becomes available to another process. If the tracd server gets very busy connections could multiply quickly. The pooling mechanism sees no available connections in the pool, it adds one. The problem is that when there are plenty of connections in the pool, given the traffic, there is no reduction in connections. The pool can only get bigger, it can't get smaller. Depending on the number of browsers hitting the site at the same time, the pool could get very large. Other than quotas on the number of connections, I don't think this should cause a problem with the database server unless the number of connections affects its performance. I don't have any information about that right now. I think that's the crucial point here though. If the number of connections is irrelevant to performance, then this is not an issue. If the number of connections is important, then it is an issue. But think, If we put a quota on the number of connections the pool could use, wouldn't that impose a performance burden on trac. When the quota is in effect, processes would have to wait for a connection to come back to the pool. I'm tired now. Ernie |
_______________________________________________ Trac mailing list Trac (at) lists.edgewall.com http://lists.edgewall.com/mailman/listinfo/trac