I have a problem with my site regularly exceeding Max User Connections. The limit from my hosting provider is 10 and I am regularly exceeding this amount for 1 database user.

I'm unsure if this is due to a Coding Error / stuck or errored cfthread / malicious attack / or some other issue.

I was thinking of coding in a fix to Automatically kill processes when the site starts to error out (exceed Max_User_Connections) to limit the amount of downtime.

Does Coldfusion allow you to run the SHOWPROCESSLIST and/or KILL methods (mySQL) in a CFQUERY. If so, would anyone recommend putting in a KILL function within application.cfc? If so, which method should I put it in? OnError or Other? Anyone have any other ideas?

This is a system administration issue and not necessarily something you'd attempt to solve via code. ColdFusion (Adobe, Railo, and OpenBD) have the ability to pool connections (they all use the same MySQL DB Driver). If you're constantly reaching your max connection value, then maybe consider using pooled connections instead of using a new connection for each query you're running.

If your host will not allow you to use pooled connections, or is unwilling to work with you, then maybe it's time to invest in a VPS. With a VPS, your database is usually hosted on your VPS, and you're able to configure connections and pooling however you need to for your app.

Here's an article from Adobe that talks about Connection Pooling and database interaction with Adobe ColdFusion:
http://helpx.adobe.com/coldfusion/kb/database-connections-handled-coldfusion.html

HTH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.