 |   |  |
 | |  |
 | |  |
 | |  |
 | |  |
 |
|
|
| Critical Defect: DB connections not being closed. |
|
|
I got a report from my webhost today and they wanted me to troubleshoot the site with them because it was creating a significant amount of database connections.
We were able to track it down to the chat room, and I got my warning from them if it keeps up they will keep taking my site down to recycle the connections. This isnt good :(
Can you guys please review the code and make sure all DB conenctions are getting closed properly?
Thanks! |
|
|
|
 |  |
|
|
| Re: Critical Defect: DB connections not being closed. |
|
|
The Swirlchat module uses the DotNetNuke dataprovider model. This means that Swirlchat uses the built in database connection management within DotNetNuke. We are not doing anything "outside the box". The DotNetNuke Dataprovider DOES indeed keep connections alive if they are being used. This is done on purpose. The reason: there is a very, very large overhead in openning and closing connections to the database. If a connection can be re-used, then it is much, much better for performance on your webserver to do so. That is exactly why DotNetNuke's Dataprovider model re-uses connections. Now, the Swirlchat module does have to make constant queries to the database (to find new messages, see who's joined a chat, get messages, send messages, etc.), so yes it may indeed keep connections open while someone is chatting. If the chat module were built to always close and re-open connections, the amount of CPU overhead would just about kill your webserver. I think your ISP should reconsider their objection. Why would you want to have connections constantly closing and re-opening? It is far better to keep the connections open and re-use them.
There are some tuning capabilities for the Swirlchat Module. On the page where you have the chat installed, login as HOST and on the ModuleMenu choose "Host Settings". This lets you set the polling interval/frequency and the "user cleanup" frequency. If you want the chat to lower its "chatter", you can set the polling frequency very high, and the user cleanup frequency very high also. This will reduce the number of queries that are transmitted to the database.
-- Will Gillen -- Swirlhost Inc. |
|
|
|
 |  |
|
|
| Re: Critical Defect: DB connections not being closed. |
|
|
Swirl Host wrote
The Swirlchat module uses the DotNetNuke dataprovider model. This means
that Swirlchat uses the built in database connection management within
DotNetNuke. We are not doing anything "outside the box". The DotNetNuke
Dataprovider DOES indeed keep connections alive if they are being used.
This is done on purpose. The reason: there is a very, very large overhead
in openning and closing connections to the database. If a connection can be
re-used, then it is much, much better for performance on your webserver to
do so. That is exactly why DotNetNuke's Dataprovider model re-uses
connections. Now, the Swirlchat module does have to make constant queries
to the database (to find new messages, see who's joined a chat, get
messages, send messages, etc.), so yes it may indeed keep connections open
while someone is chatting. If the chat module were built to always close
and re-open connections, the amount of CPU overhead would just about kill
your webserver. I think your ISP should reconsider their objection. Why
would you want to have connections constantly closing and re-opening? It is
far better to keep the connections open and re-use them.
There are some tuning capabilities for the Swirlchat Module. On the page
where you have the chat installed, login as HOST and on the ModuleMenu
choose "Host Settings". This lets you set the polling interval/frequency
and the "user cleanup" frequency. If you want the chat to lower its
"chatter", you can set the polling frequency very high, and the user cleanup
frequency very high also. This will reduce the number of queries that are
transmitted to the database.
-- Will Gillen
-- Swirlhost Inc. |
Wish I had known this beforehand. This is not good. I have like 5 people using my site right now and see an issue with this. |
|
|
|
|  |
 | |  |
 | |  |
 | |  |
|