Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a monitoring app that checks MySQL's Threads_connected and Max_used_connections variables every X seconds.

Neither of these variables tells me what I want to know: The highest number of concurrent connections since the last check (X seconds ago).

In the past, I've used FLUSH STATUS to reset Max_used_connections some time after the critical level is reached, but this method isn't ideal for a number of reasons, and according to the docs:

This is something you should use only when debugging a query.

Before I head down the path of a complicated analysis of the query log, is there anything I'm overlooking?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The only thing I can think of is finding some what (maybe through a cron job) to record the 'Threads_connected' values every minute, and then calculate the max of these values.

I'm not sure if you can do exactly what you are asking for without resetting the 'Max_used_connections' before your monitoring period.

share|improve this answer
    
Thanks for the answer Dave. I am tracking Threads_connected every 5 minutes, and that does alert me to serious trouble. I just wish I could see that value over time... Running a cron on the target system is out of the question. –  xofer Oct 4 '11 at 13:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.