Skip to content

Commit 4b6641d

Browse files
committed
Merge branch 'chore/slow-query'
2 parents 537da18 + 3594d09 commit 4b6641d

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

docker-compose/db/my.cnf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[mysqld]
2+
# Character Set
3+
character-set-server=utf8mb4
4+
collation-server=utf8mb4_unicode_ci
5+
skip-character-set-client-handshake
6+
7+
# Slow Query Log Configuration
8+
slow_query_log = 1
9+
slow_query_log_file = /var/log/mysql/slow-query.log
10+
long_query_time = 10
11+
log_queries_not_using_indexes = 0
12+
log_slow_admin_statements = 1
13+
log_slow_replica_statements = 1
14+
15+
# Performance Schema for MySQL Exporter
16+
performance_schema = ON
17+
performance_schema_instrument = 'statement/%=ON'
18+
performance_schema_consumer_statements_digest = ON

docker-compose/docker-compose.prod.infra.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ services:
66
- '$MYSQL_PORT:3306'
77
volumes:
88
- denamu-mysql:/var/lib/mysql
9+
- ./db/my.cnf:/etc/mysql/conf.d/my.cnf:ro
10+
- denamu-mysql-logs:/var/log/mysql
911
networks:
1012
- Denamu
1113
env_file:
1214
- /var/prod_config/infra/.env.prod
13-
command:
14-
- --character-set-server=utf8mb4
15-
- --collation-server=utf8mb4_unicode_ci
16-
- --skip-character-set-client-handshake
1715
healthcheck:
1816
test:
1917
[
@@ -152,6 +150,7 @@ services:
152150

153151
volumes:
154152
denamu-mysql:
153+
denamu-mysql-logs:
155154
denamu-redis:
156155
denamu-rabbitmq:
157156
denamu-prometheus:

0 commit comments

Comments
 (0)