Is your website database crashing frequently?
Take a look at how the “performance schema” feature in MariaDB helps to monitor the database and fix bad queries efficiently.
At Bobcares, we often receive requests to tweak database server settings as part of our Server Management Services.
Today, let us discuss how our Support Engineers do it easily for our customers.
When to use performance schema?
Performance Schema is a feature of database servers which was introduced in MariaDB from version 5.5. Once we enable the feature, it will store all performance-related data in the respective tables under it.
Thus it gives clear details on the status of the database server. This comes handy in troubleshooting the SQL queries.
The set of tables in the performance schema show up as:
Performance schema is an under-utilized tool for monitoring MySQL databases.
In short, it automatically records statistics about how the MariaDB server behavior. Thus, it helps to fix bad queries and add proper indexes.
The relevance of enabling performance schema in MariaDB servers
Moreover, enabling performance schema comes with benefits like:
- It will not affect the underlying Mysql service.
- We can troubleshoot Mysql’s bad queries more effectively.
- It collects all the information in the tables, so we can query it easily.
- Its statistics will get reset every time we restart the MariaDB server.
How we enable performance schema in MariaDB?
In MariaDB, performance schema would be OFF by default.
Recently, one of our customers approached us with a query. He had problems with the database server performance. He wanted to turn ON the performance schema to automatically record all bad queries on his MariaDB server.
Our Support Engineers followed the below steps to do it.
1. Firstly, we locate the MariaDB configuration file. In Linux/Unix, it is found at /etc/mysql/my.cnf. Similarly, in Windows, it will be at C:INSTALLDIRMariaDB 10.1my.cnf, which resides in the MySQL install directory.
2. Then, we edit the configuration file. Here, the performance schema is OFF by default. We make the following change.
peformance_schema = ON
After that, we save this file.
3. Finally, we restart the MariaDB service.
So, this is how we enable the performance schema. Also, the performance schema’s statistics will get reset every time we restart the MariaDB server.
[Need more assistance to enable performance schema in MariaDB? – We are available 24/7 to help you.]
In short, we enable performance schema in MariaDB in order to record all performance parameters of the database server. In today’s writeup, we saw how our Support Engineers do it easily for our customers.