[dancer-users] High CPU usage on DB

Warren Young warren at etr-usa.com
Thu Dec 8 17:33:01 GMT 2016

On Dec 8, 2016, at 10:27 AM, Zahir Lalani <ZahirLalani at oliver.agency> wrote:
> We use the Dancer database module to create a connection

Are you caching those connections or re-opening a fresh one for every request?

And if the latter, are you *closing* the connection before returning the queried data to the client?  Are you sure, evidenced by monitoring the OS’s open file handles counter?

You don’t say which OS this is, but if it’s Linux:

    ls /proc/$(pidof my-dancer-program)/fd | wc -l

> so in this case we have 20 connections to the DB

So you believe.  Double-check.

> a restart of Starman cures the problem

That sure sounds like a leaked resource of some kind.  I have you chasing DB file handles.  You say it isn’t leaked memory.  If not either of those, then it could be web sockets or any similar sort of thing.

More information about the dancer-users mailing list