When adding a remote MySQL instance to Percona Monitoring and Management (PMM), there are a few options you can specify during the setup, but they are not editable once added. For example, a table statistics limit is introduced to avoid querying information_schema.tables that may impact DB performance, especially with a high number of DBs / tables present in an instance.

table statistics limit

What if you want to change the value later on? One way to do this is to remove the instance and add it back, but you’ll lose some stats/historical data.

It is nice to have the ability to change settings from GUI, but when you don’t have it, a little hack here and there can save the day. Also, it might give a bit of that excitement when you wonder: “What’s inside that toy?” Let’s roll up our sleeves and do it safely without breaking the toy.

Below is an example of an alternative approach to re-adding the instance. In the example, we run PMM server in a docker container.

1. Let’s get inside the container first:

 

If you don’t know the container id, run the following:

 

2. Once inside, login to the PostgreSQL database (that’s where PMM keeps some of the settings):

Switch to vertical output for the sake of readability, analog to using \G in MySQL at the end of the query or running mysql with -E key, but in PostgreSQL, it is a setting:

 

3. Check what agents you want to update:

 

4. Update settings for the required agent(s):

 

Check:

 

5. Restart the PMM agent in the PMM server container:

 

Conclusion

So, we can see it is possible to fine-tune some hidden settings of Percona Monitoring and Management by getting into its internals, including editing some options after adding a remote MySQL instance without having to remove and re-add the instance.

I hope you find the article useful and somewhat entertaining. Also, if you feel a PMM feature is missing, you can file an enhancement request in our bugtracker.

Percona Monitoring and Management is a best-of-breed open source database monitoring solution. It helps you reduce complexity, optimize performance, and improve the security of your business-critical database environments, no matter where they are located or deployed.

 

Download Percona Monitoring and Management Today

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments