5

We have deployed REDIS to hold some frequent query result to reduce number of connections made on Database server. We need to find out Max_used_connection after deploying REDIS. So we plan to reset mysql status variable Max_used_connection.

While googling i found to reset Max_used_connections we need to use FLUSH STATUS.

Is it safe to execute Flush status in production ? MySQL docs says:

FLUSH STATUS - resets the counters for key caches (default and named) to zero and sets Max_used_connections to the current number of open connections.

I don't know impact of resetting counters for key caches.

Is it possible to reset Max_used_connections alone ?

Thanks in Advance.

2 Answers 2

5

Is it safe to execute Flush status in production ?

  • Well it should not affect anything as such but resets the status counters and you should be "Safe".

Is it possible to reset Max_used_connections alone ?

  • No

but "We need to find out Max_used_connection after deploying ...."

  • How about introducing graphs into monitoring? Say Cacti / Grafana will give you good glances over what's-going-on-inside-your-mysql!
3

No, it is not safe to run FLUSH STATUS in MySQL. If you run this command on a replica and you have GTIDs enabled, this creates an errant GTID on that replica because FLUSH STATUS ends-up in the binary log. The safe way to run this command is FLUSH LOCAL STATUS or FLUSH NO_WRITE_TO_BINLOG STATUS.

Running FLUSH STATUS on a primary is safe-ish, but it will also propagate to all replicas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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