Skip to content

Commit 1477861

Browse files
szachovyCopilot
andcommitted
Enable MySQL slow query log for performance diagnostics
Add slow_query_log=ON, long_query_time=2, log_queries_not_using_indexes=ON to capture queries exceeding 2 seconds or performing full table scans. Closes #76 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ab8ce7 commit 1477861

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Dependabot updates for `github-actions` and `terraform` ecosystems. (#29)
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
18+
* MySQL slow query log for queries exceeding 2 seconds or not using indexes. (#76)
1819

1920
### Changed
2021

services/mysql-server/mysql_config.cnf.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ ssl-key = "/etc/mysql/ssl/mysql_server_key.pem"
1414
require_secure_transport = "ON"
1515
max_connections = "50"
1616
max_connect_errors = "50"
17+
slow_query_log = "ON"
18+
long_query_time = "2"
19+
log_queries_not_using_indexes = "ON"
20+
slow_query_log_file = "/var/log/mysql/slow-queries.log"

0 commit comments

Comments
 (0)