Skip to content

Commit d46ab88

Browse files
committed
Updated galera test
1 parent a7d8b81 commit d46ab88

File tree

8 files changed

+221
-54
lines changed

8 files changed

+221
-54
lines changed

mariadb-galera-topolvm/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ include ../make/base.mk
66
mariadb: kubectl ## Deploy MariaDB.
77
$(KUBECTL) apply -f ./mariadb
88

9+
.PHONY: maxscale
10+
maxscale: kubectl ## Deploy MaxScale.
11+
$(KUBECTL) apply -f ./maxscale
12+
913
.PHONY: sysbench-sql
1014
sysbench-sql: kubectl ## Prepare sysbench SQL resources.
1115
$(KUBECTL) apply -f ./sql

mariadb-galera-topolvm/README.md

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,76 @@
22

33
```bash
44
make mariadb
5+
make maxscale
56
make sysbench-prepare
67
make sysbench
78
make physicalbackup
89
```
910

10-
# sysbench (64 threads)
11+
# sysbench
12+
13+
Threads: 4
14+
15+
MariaDB version: 11.8.2
16+
17+
MaxScale version: 23.08.5
18+
19+
### Galera
20+
21+
```
22+
SQL statistics:
23+
queries performed:
24+
read: 5084912
25+
write: 1280228
26+
other: 898557
27+
total: 7263697
28+
transactions: 363093 (1210.29 per sec.)
29+
queries: 7263697 (24212.01 per sec.)
30+
ignored errors: 115 (0.38 per sec.)
31+
reconnects: 0 (0.00 per sec.)
32+
33+
General statistics:
34+
total time: 300.0033s
35+
total number of events: 363093
36+
37+
Latency (ms):
38+
min: 2.09
39+
avg: 3.30
40+
max: 211.73
41+
95th percentile: 4.33
42+
sum: 1199473.28
43+
44+
Threads fairness:
45+
events (avg/stddev): 90773.2500/18.16
46+
execution time (avg/stddev): 299.8683/0.00
47+
```
48+
49+
### Galera + MaxScale
1150

1251
```
1352
SQL statistics:
1453
queries performed:
15-
read: 7962192
16-
write: 2028781
17-
other: 1368579
18-
total: 11359552
19-
transactions: 564946 (1882.96 per sec.)
20-
queries: 11359552 (37861.23 per sec.)
21-
ignored errors: 3782 (12.61 per sec.)
54+
read: 3987480
55+
write: 1015376
56+
other: 693250
57+
total: 5696106
58+
transactions: 284744 (949.12 per sec.)
59+
queries: 5696106 (18986.52 per sec.)
60+
ignored errors: 76 (0.25 per sec.)
2261
reconnects: 0 (0.00 per sec.)
2362
2463
General statistics:
25-
total time: 300.0306s
26-
total number of events: 564946
64+
total time: 300.0074s
65+
total number of events: 284744
2766
2867
Latency (ms):
29-
min: 8.48
30-
avg: 33.98
31-
max: 148.02
32-
95th percentile: 49.21
33-
sum: 19199519.25
68+
min: 2.51
69+
avg: 4.21
70+
max: 20.05
71+
95th percentile: 5.37
72+
sum: 1199566.83
3473
3574
Threads fairness:
36-
events (avg/stddev): 8827.2812/26.37
37-
execution time (avg/stddev): 299.9925/0.01
75+
events (avg/stddev): 71186.0000/7174.01
76+
execution time (avg/stddev): 299.8917/0.01
3877
```

mariadb-galera-topolvm/mariadb/mariadb.yaml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,33 @@ spec:
77
name: mariadb
88
key: root-password
99

10+
# maxScaleRef:
11+
# name: maxscale
12+
1013
# bootstrapFrom:
1114
# backupContentType: Physical
12-
# volume:
13-
# nfs:
14-
# server: 10.0.0.50
15-
# path: /volume1/mariadb
15+
# s3:
16+
# bucket: database
17+
# prefix: mariadb-galera/physical
18+
# endpoint: minio.storage.svc.cluster.local:443
19+
# accessKeyIdSecretKeyRef:
20+
# name: minio
21+
# key: access-key-id
22+
# secretAccessKeySecretKeyRef:
23+
# name: minio
24+
# key: secret-access-key
25+
# tls:
26+
# enabled: true
27+
# caSecretKeyRef:
28+
# name: homelab-bundle
29+
# key: ca.crt
30+
# stagingStorage:
31+
# persistentVolumeClaim:
32+
# resources:
33+
# requests:
34+
# storage: 10Gi
35+
# accessModes:
36+
# - ReadWriteOnce
1637
# restoreJob:
1738
# resources:
1839
# requests:
@@ -45,19 +66,23 @@ spec:
4566

4667
resources:
4768
requests:
48-
cpu: 2
69+
cpu: 4
4970
memory: 4Gi
5071
limits:
72+
cpu: 4
5173
memory: 4Gi
5274

5375
myCnf: |
5476
[mariadb]
5577
bind-address=*
5678
default_storage_engine=InnoDB
5779
binlog_format=row
80+
max_allowed_packet=1G
5881
innodb_autoinc_lock_mode=2
5982
innodb_buffer_pool_size=3200MB
60-
max_allowed_packet=1GB
83+
innodb_flush_method=O_DIRECT
84+
thread_handling=pool-of-threads
85+
thread_pool_size=4
6186
6287
tolerations:
6388
- effect: NoSchedule
@@ -74,3 +99,18 @@ spec:
7499
operator: In
75100
values:
76101
- compute-large
102+
103+
livenessProbe:
104+
failureThreshold: 10
105+
periodSeconds: 10
106+
timeoutSeconds: 5
107+
108+
readinessProbe:
109+
failureThreshold: 10
110+
periodSeconds: 10
111+
timeoutSeconds: 5
112+
113+
startupProbe:
114+
failureThreshold: 10
115+
periodSeconds: 10
116+
timeoutSeconds: 5
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: maxscale
5+
labels:
6+
k8s.mariadb.com/watch: ""
7+
stringData:
8+
password: MaxScale11!
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apiVersion: k8s.mariadb.com/v1alpha1
2+
kind: MaxScale
3+
metadata:
4+
name: maxscale
5+
spec:
6+
replicas: 2
7+
8+
mariaDbRef:
9+
name: mariadb
10+
11+
services:
12+
- name: rw-router
13+
router: readwritesplit
14+
listener:
15+
port: 3306
16+
17+
auth:
18+
generate: true
19+
adminUsername: mariadb-operator
20+
adminPasswordSecretKeyRef:
21+
name: maxscale
22+
key: password
23+
24+
metrics:
25+
enabled: true
26+
27+
resources:
28+
requests:
29+
cpu: 2
30+
memory: 1Gi
31+
limits:
32+
cpu: 2
33+
memory: 1Gi
34+
35+
tolerations:
36+
- effect: NoSchedule
37+
key: node.mmontes.io/type
38+
value: compute-large
39+
40+
affinity:
41+
podAntiAffinity:
42+
requiredDuringSchedulingIgnoredDuringExecution:
43+
- labelSelector:
44+
matchExpressions:
45+
- key: app.kubernetes.io/instance
46+
operator: In
47+
values:
48+
- maxscale
49+
topologyKey: kubernetes.io/hostname
50+
nodeAffinity:
51+
requiredDuringSchedulingIgnoredDuringExecution:
52+
nodeSelectorTerms:
53+
- matchExpressions:
54+
- key: node.mmontes.io/type
55+
operator: In
56+
values:
57+
- compute-large

mariadb-galera-topolvm/physicalbackup/physicalbackup-nfs.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: k8s.mariadb.com/v1alpha1
2+
kind: PhysicalBackup
3+
metadata:
4+
name: physicalbackup-s3
5+
spec:
6+
mariaDbRef:
7+
name: mariadb
8+
schedule:
9+
cron: "*/5 * * * *"
10+
suspend: false
11+
immediate: true
12+
compression: bzip2
13+
storage:
14+
s3:
15+
bucket: database
16+
prefix: mariadb-galera/physical
17+
endpoint: minio.storage.svc.cluster.local:443
18+
accessKeyIdSecretKeyRef:
19+
name: minio
20+
key: access-key-id
21+
secretAccessKeySecretKeyRef:
22+
name: minio
23+
key: secret-access-key
24+
tls:
25+
enabled: true
26+
caSecretKeyRef:
27+
name: homelab-bundle
28+
key: ca.crt
29+
stagingStorage:
30+
persistentVolumeClaim:
31+
resources:
32+
requests:
33+
storage: 10Gi
34+
accessModes:
35+
- ReadWriteOnce
36+
timeout: 1h
37+
podAffinity: true
38+
tolerations:
39+
- effect: NoSchedule
40+
key: node.mmontes.io/type
41+
value: compute-large
42+
resources:
43+
requests:
44+
cpu: 1
45+
memory: 512Mi
46+
limits:
47+
cpu: 1
48+
memory: 512Mi

mariadb-galera-topolvm/sysbench/sysbench-cronjob.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ spec:
3333
- --tables=5
3434
- --table_size=1000000
3535
- --mysql-host=mariadb-primary.default.svc.cluster.local
36+
# - --mysql-host=maxscale.default.svc.cluster.local
3637
- --mysql-port=3306
3738
- --mysql-user=sbtest
3839
- --mysql-password=MariaDB11!
3940
- --mysql-db=sbtest
4041
- --time=300
41-
- --threads=64
42+
- --threads=4
4243
- --report-interval=1
4344
- run
4445
resources:

0 commit comments

Comments
 (0)