kInterbaseDA multiple connection
Hello list, this is my first post here. I'm running Zope connected to Firebird with kinterbasDA. DB admin has recently told me that there were two active connections to the base under Zope user while there's only one instance of database adapter. I've checked it by running netstat -a on Zope host, here's the output -- tcp 0 0 zope_host:41838 db_host:gds_db ESTABLISHED tcp 0 0 zope_host:41042 db_host:gds_db ESTABLISHED -- The second connections appears short time after Zope restarts, so either DA or kinterbase itself seems to lose active connection. What's more interesting is that number of connections doesn't grow anymore remaining at point of 2. Has anyone encountered similar problem? I'm using Zope 2.7.2, python 2.3.4 on debian kinterbasdb 3.1pre9 kinterbaseDA 2.0 Firebird 1.5 PS Sorry for my poor english :)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Konstantin E. Steuck wrote: | Hello list, this is my first post here. | | I'm running Zope connected to Firebird with kinterbasDA. | DB admin has recently told me that there were two active connections to | the base under Zope user while there's only one instance of database | adapter. | | I've checked it by running netstat -a on Zope host, here's the output | -- | tcp 0 0 zope_host:41838 db_host:gds_db ESTABLISHED | tcp 0 0 zope_host:41042 db_host:gds_db ESTABLISHED | -- | | The second connections appears short time after Zope restarts, so either | DA or kinterbase itself seems to lose active connection. | What's more interesting is that number of connections doesn't grow | anymore remaining at point of 2. Each application server thread in your application holds a separate instance of the adapter, which means that unless the adapter is coded (which I doubt) to multiplex requests from separate instances across a single, global connection, you could see as many connections as you have appserver threads. | Has anyone encountered similar problem? | | I'm using | Zope 2.7.2, python 2.3.4 on debian | kinterbasdb 3.1pre9 | kinterbaseDA 2.0 | Firebird 1.5 | | PS Sorry for my poor english :) No need to apologise -- your English is much better than my Russian. Tres. - -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCF6XDGqWXf00rNCgRAvLwAKCeOuRia7WQo8OK3L0XUWHamIGtXQCfViLi LzW9PvHIYNG4JNOgbRRFJeY= =zeW0 -----END PGP SIGNATURE-----
Thanks for you reply, Tres Tres Seaver wrote:
Each application server thread in your application holds a separate instance of the adapter, which means that unless the adapter is coded (which I doubt) to multiplex requests from separate instances across a single, global connection, you could see as many connections as you have appserver threads.
Does it mean that number of active connections can grow even more due to thread count growth? Will it decrease when the thread stops? Konstantin
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Konstantin E. Steuck wrote: | Thanks for you reply, Tres | | Tres Seaver wrote: | | > Each application server thread in your application holds a separate | > instance of the adapter, which means that unless the adapter is coded | > (which I doubt) to multiplex requests from separate instances across a | > single, global connection, you could see as many connections as you | > have appserver threads. | | Does it mean that number of active connections can grow even more due to | thread count growth? Will it decrease when the thread stops? By default, Zope is configured to run with four appserver threads (see the 'zserver-threads' option in zope.conf). I misspoke slightly in my first post: the DA connection is actually held inside a database connection, of which there are seven by default (the 'connection-pool' zope.conf parameter controls this). Normally, an appserver thread acquires a connection at the start of the request, and the returns it to the pool of available connections. So, the absolute maximum number of open DA connections is the number of ZODB database connections in the pool (7), while the "likely" high number is lower, depending on your usage patterns (4 if all 4 appserver threads stay busy, and use the DA). Tres. - -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCGJmRGqWXf00rNCgRAoPkAKCPjLHmkcFp2zjzRbvkB/Z6hKlTDACfUS2V uryu+r8+6j6O720xL5XCRh8= =8SIx -----END PGP SIGNATURE-----
Tres Seaver wrote:
By default, Zope is configured to run with four appserver threads (see the 'zserver-threads' option in zope.conf). I misspoke slightly in my first post: the DA connection is actually held inside a database connection, of which there are seven by default (the 'connection-pool' zope.conf parameter controls this).
Normally, an appserver thread acquires a connection at the start of the request, and the returns it to the pool of available connections. So, the absolute maximum number of open DA connections is the number of ZODB database connections in the pool (7), while the "likely" high number is lower, depending on your usage patterns (4 if all 4 appserver threads stay busy, and use the DA). Thanks a lot, Tres. Now I know what to tell if asked "why are there so many connections to database" :)
Tres Seaver <tseaver@zope.com> wrote:
| > Each application server thread in your application holds a separate | > instance of the adapter, which means that unless the adapter is coded | > (which I doubt) to multiplex requests from separate instances across a | > single, global connection, you could see as many connections as you | > have appserver threads. | | Does it mean that number of active connections can grow even more due to | thread count growth? Will it decrease when the thread stops?
By default, Zope is configured to run with four appserver threads (see the 'zserver-threads' option in zope.conf). I misspoke slightly in my first post: the DA connection is actually held inside a database connection, of which there are seven by default (the 'connection-pool' zope.conf parameter controls this).
I think you mean 'pool-size', not 'connection-pool'. Florent
Normally, an appserver thread acquires a connection at the start of the request, and the returns it to the pool of available connections. So, the absolute maximum number of open DA connections is the number of ZODB database connections in the pool (7), while the "likely" high number is lower, depending on your usage patterns (4 if all 4 appserver threads stay busy, and use the DA).
-- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (3)
-
Florent Guillaume -
Konstantin E. Steuck -
Tres Seaver