1

How do I find out how many connections were made to the mysql server in a given duration?

2 Answers 2

1

What I'd do rather than enabling log (which can be very IO intensive on big production servers) is to have a look at the output of SHOW STATUS. With that you can have a look at the connections variable (and lot others, usually broken down per type). So you can have a look at that number at a given time and later on, and find out how many connections were made.

Have a look at http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html#statvar_Connections and friends.

Best bet is also to have some kind of graphing from these values.

1

Start mysqld with --log to enable the general query log. Then use grep to find the appropriate timespan and search for/count connections.

The general query log tends to grow quickly, and you might want to turn it on only for bugfixing. If you keep it on, you need to roll/truncate the logs frequently.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .