bigpresh/Dancer-Plugin-Database

setting to disconnect at end of request by default?

msouth opened this issue · 1 comments

I just encountered an issue with an app going into production that had not been sufficiently volume tested. The starman workers were holding their database connections open and exceeded the max number of connections in mysql.

For mysql, in particular, there are people that recommend just reconnecting every time because connections are cheap. It might be nice to have a setting that would call disconnect at the end of a request.

possibly (peripherally) related to #10

Firstly, sorry this received no attention for so long

Hmm - in general I'd say the fix is to increase the number of connections to mysql rather than having your app connect and disconnect for every HTTP request - I believe you'll find much better performance.

However - it shouldn't be that difficult to provide a setting that causes an after hook to disconnect the connection, I'd say.