Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

add performance_schema property #204

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,22 @@ See the [proxy](jobs/proxy/spec) and [acceptance-tests](jobs/acceptance-tests/sp
The slow query log is enabled and you can find long query exceeded 10 seconds (by default) in `/var/vcap/sys/log/mysql/mysql_slow_query.log`

To change the threshold above which SQL queries get logged in the slow query log file, update `cf_mysql.mysql.long_query_time` (time in seconds/microseconds).

### Performance schema ###

The Performance Schema is a feature for monitoring server performance, see related mariadb documentation : [https://mariadb.com/kb/en/library/performance-schema/](https://mariadb.com/kb/en/library/performance-schema/ "https://mariadb.com/kb/en/library/performance-schema/").
Performance_schema database, consists of a number of tables that can be queried with regular SQL statements, returning specific performance information.

To activate Performance_schema, update `cf_mysql.mysql.performance_schema_enabled` property in mysql instance group.

Performance_schema uses a memory engine (performance_schema) which can potentially increase memory usage when enabled.
To see memory used by performance_schema in bytes:

```
MariaDB [(none)]> show engine performance_schema status;
+--------------------+--------------------------------------------------------------+-----------+
| Type | Name | Status |
+--------------------+--------------------------------------------------------------+-----------+
...
| performance_schema | performance_schema.memory | 131117680 |
+--------------------+--------------------------------------------------------------+-----------+
3 changes: 3 additions & 0 deletions jobs/mysql/spec
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,6 @@ properties:
default: 10
description: 'Threshold in seconds above which SQL queries get logged in the slow query log file'

cf_mysql.mysql.performance_schema_enabled:
default: false
description: "Enables Mariadb Performance Schema when set to true"
14 changes: 14 additions & 0 deletions jobs/mysql/templates/my.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,20 @@ ssl_cert = /var/vcap/jobs/mysql/certificates/server-cert.
ssl_key = /var/vcap/jobs/mysql/certificates/server-key.pem
<% end %>

<% if p('cf_mysql.mysql.performance_schema_enabled') %>
performance_schema = ON
# Specifies the maximum number of few instruments to limit memory consumption under 125Mb with 1500 connections
performance_schema_max_cond_instances = 1270 #Specifies the maximum number of instrumented condition objects. (default automated sizing : 2540)
performance_schema_max_mutex_instances = 2215 #Specifies the maximum number of instrumented mutex instances. (default automated sizing : 8860)
performance_schema_max_rwlock_instances = 1000 #Specifies the maximum number of instrumented rwlock objects. (default automated sizing : 4620)
performance_schema_max_socket_instances = 230 #Specifies the maximum number of instrumented socket objects. (default automated sizing : 640)
performance_schema_max_table_handles = 1000 #Specifies the maximum number of opened table objects (default automated sizing : 2000)
performance_schema_max_table_instances = 1000 #Specifies the maximum number of instrumented table objects (default automated sizing : 12500)
performance_schema_max_thread_instances = 360 #Specifies how many of the running server threads can be instrumented. (default automated sizing : 720)
<% else %>
performance_schema = OFF
<% end %>

[mysqldump]
quick
quote-names
Expand Down