To have more visibility of our systems I needed a method to quickly query large sets of MySQL servers. Though there are few methods like ‘xargs -P’ and dsh, they are overkill for the SQL-only job, and simply not fast enough.
So, I hacked pmysql (274 lines of C) – a tool that is able to run queries on multiple servers in parallel. It can run SQL query on 1000 servers in under 0.1s, and scales well with larger sets of servers.
Use cases can be various – from configuration/schema checks (I
really enjoyed using information_schema), to ‘global processlist’
analysis.
Ability to crunch hundreds of megabytes of processlist info in
few seconds – priceless, so is schema verification of millions of
tables.
It is fast enough to use it as backend for some of real-time health check CGI …
[Read more]