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

Configureable slow query threshold #185

Merged
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
7 changes: 7 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ Note 1: If a seeded database is renamed in the manifest, a new database will be
Note 2: If all you need is a database deployment, it is possible to deploy this
release with zero broker instances and completely remove any dependencies on Cloud Foundry.
See the [proxy](jobs/proxy/spec) and [acceptance-tests](jobs/acceptance-tests/spec) spec files for standalone configuration options.

## Instance tuning ##
### slow query log ###

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).
5 changes: 5 additions & 0 deletions jobs/mysql/spec
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,8 @@ properties:
cf_mysql.mysql.enable_galera:
default: true
description: 'Advanced feature. Only use this when deploying a single MySQL node with no intention to run any other components of cf-mysql-release.'

cf_mysql.mysql.long_query_time:
default: 10
description: 'Threshold in seconds above which SQL queries get logged in the slow query log file'

1 change: 1 addition & 0 deletions jobs/mysql/templates/my.cnf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ log_bin_trust_function_creators = 1
# Slow query logging:
slow_query_log = 1
slow_query_log_file = /var/vcap/sys/log/mysql/mysql_slow_query.log
long_query_time = <%= p('cf_mysql.mysql.long_query_time') %>
<% if p('cf_mysql.mysql.log_queries_not_using_indexes') %>
log_queries_not_using_indexes = ON
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion jobs/mysql/templates/my.cnf.erb.shasum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6f51768902ab19b8167cbaad94c9c967c7f33dd9
1ace844bb57360a9c72cbe502c7f28c95da39594