cloudfoundry / cf-mysql-release

Cloud Foundry MySQL Release
Apache License 2.0
58 stars 106 forks source link

add performance_schema property #204

Open ldangeard-orange opened 6 years ago

ldangeard-orange commented 6 years ago

This PR optionally enables operators to enable performance_schema feature in MariaDB. This requires setting the cf_mysql.mysql.performance_schema_enabled property to true in mysql instance group (default is false)

In MariaDB distribution , by default performance_schema is OFF since 10.0.12. See doc performance_schema

The performance_schema instrument flags (e.g. performance_schema_max_file_handles) are given sensible defaults based on Orange production usage (which sometimes slightly differ from mariadb defaults).

Documentation mentions possible memory impact of turning on the feature and ways to measure it. We need to specifie the maximum number of few instruments to limit memory consumption under 125Mb (instead of 660Mb) with 1500 connections :

performance_schema_max_cond_instances   = 1270         (default automated sizing : 2540)
performance_schema_max_mutex_instances  = 2215         (default automated sizing : 8860)
performance_schema_max_rwlock_instances = 1000         (default automated sizing : 4620)
performance_schema_max_socket_instances = 230          (default automated sizing : 640)
performance_schema_max_table_handles    = 1000         (default automated sizing : 2000)       
performance_schema_max_table_instances  = 1000         (default automated sizing : 12500)    
performance_schema_max_thread_instances = 360          (default automated sizing : 720) 

Background

The Performance Schema is a feature for monitoring server performance, see related mariadb documentation.

Performance_schema database, consists of a number of tables that can be queried with regular SQL statements, returning specific performance information.

Numerous community monitoring tools leverage the Performance Schema feature, such as :

This PR replaces #190

cfdreddbot commented 6 years ago

Hey ldangeard-orange!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/156545900

The labels on this github issue will be updated when the story is started.

ldangeard-orange commented 6 years ago

is it possible to integrate my PR? By default, the function performance_schema is not active, and therefore has no impact on the operation of the release.

ldangeard-orange commented 5 years ago

hy, in the pxc-release, performance_schema variable system mysql is not set. With percona distribution, performance_schema is enable by default.