Skip to content

Commit 95ff084

Browse files
committed
Apply DB performance optimizations also for github actions
1 parent 1c10d36 commit 95ff084

File tree

3 files changed

+69
-5
lines changed

3 files changed

+69
-5
lines changed

.github/workflows/unit_tests.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ jobs:
5454
--health-interval 10s
5555
--health-timeout 5s
5656
--health-retries 5
57+
--tmpfs /var/lib/postgresql/data
58+
--shm-size=256m
59+
postgres
60+
-c fsync=off
61+
-c synchronous_commit=off
62+
-c full_page_writes=off
63+
-c log_statement=all
64+
-c checkpoint_segments=32
65+
-c checkpoint_completion_target=0.9
66+
-c wal_buffers=16MB
67+
-c shared_buffers=256MB
5768
ports:
5869
- 5432:5432
5970
steps:
@@ -83,7 +94,21 @@ jobs:
8394
env:
8495
MYSQL_DATABASE: cc_test
8596
MYSQL_ROOT_PASSWORD: password
86-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
97+
options: >-
98+
--health-cmd="mysqladmin ping"
99+
--health-interval=10s
100+
--health-timeout=5s
101+
--health-retries=3
102+
--tmpfs /var/lib/mysql
103+
--tmpfs /tmp
104+
--innodb-flush-method=nosync
105+
--innodb-flush-log-at-trx-commit=0
106+
--innodb-doublewrite=0
107+
--innodb-buffer-pool-size=256M
108+
--innodb-log-buffer-size=16M
109+
--innodb-log-file-size=64M
110+
--skip-innodb-checksums
111+
--skip-sync-frm
87112
ports:
88113
- 3306:3306
89114
steps:
@@ -98,4 +123,4 @@ jobs:
98123
status: ${{ job.status }}
99124
notify_when: 'failure' # default is 'success,failure,warnings'
100125
env:
101-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
126+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required

.github/workflows/unit_tests_backwards_compatibility.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ concurrency:
44
cancel-in-progress: true
55
on:
66
workflow_dispatch:
7-
description: "This action tests backwards compatibility when db migrations are introduced. It tests database schema at new code(old_cc_ref) with unittests running old code(new_cc_ref) "
87
inputs:
98
old_cc_ref:
109
description: 'Old Version of CC_NG that the backwards compatibility should be checked against'
@@ -44,6 +43,17 @@ jobs:
4443
--health-interval 10s
4544
--health-timeout 5s
4645
--health-retries 5
46+
--tmpfs /var/lib/postgresql/data
47+
--shm-size=256m
48+
postgres
49+
-c fsync=off
50+
-c synchronous_commit=off
51+
-c full_page_writes=off
52+
-c log_statement=all
53+
-c checkpoint_segments=32
54+
-c checkpoint_completion_target=0.9
55+
-c wal_buffers=16MB
56+
-c shared_buffers=256MB
4757
ports:
4858
- 5432:5432
4959
steps:
@@ -92,7 +102,21 @@ jobs:
92102
env:
93103
MYSQL_DATABASE: cc_test
94104
MYSQL_ROOT_PASSWORD: password
95-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
105+
options: >-
106+
--health-cmd="mysqladmin ping"
107+
--health-interval=10s
108+
--health-timeout=5s
109+
--health-retries=3
110+
--tmpfs /var/lib/mysql
111+
--tmpfs /tmp
112+
--innodb-flush-method=nosync
113+
--innodb-flush-log-at-trx-commit=0
114+
--innodb-doublewrite=0
115+
--innodb-buffer-pool-size=256M
116+
--innodb-log-buffer-size=16M
117+
--innodb-log-file-size=64M
118+
--skip-innodb-checksums
119+
--skip-sync-frm
96120
ports:
97121
- 3306:3306
98122
steps:
@@ -125,4 +149,4 @@ jobs:
125149
- name: Setup Environment
126150
uses: ./.github/workflows/composite/setup
127151
- name: Run tests
128-
run: DB=mysql MYSQL_CONNECTION_PREFIX="mysql2://root:[email protected]:3306" bundle exec rake spec:without_migrate
152+
run: DB=mysql MYSQL_CONNECTION_PREFIX="mysql2://root:[email protected]:3306" bundle exec rake spec:without_migrate

docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,17 @@ services:
1616
- "full_page_writes=off"
1717
- "-c"
1818
- "log_statement=all"
19+
- "-c"
20+
- "checkpoint_segments=32"
21+
- "-c"
22+
- "checkpoint_completion_target=0.9"
23+
- "-c"
24+
- "wal_buffers=16MB"
25+
- "-c"
26+
- "shared_buffers=256MB"
1927
tmpfs:
2028
- /var/lib/postgresql/data
29+
shm_size: 256m
2130
ports:
2231
- "127.0.0.1:5432:5432"
2332
networks:
@@ -39,8 +48,14 @@ services:
3948
- "--innodb-flush-method=nosync"
4049
- "--innodb-flush-log-at-trx-commit=0"
4150
- "--innodb-doublewrite=0"
51+
- "--innodb-buffer-pool-size=256M"
52+
- "--innodb-log-buffer-size=16M"
53+
- "--innodb-log-file-size=64M"
54+
- "--skip-innodb-checksums"
55+
- "--skip-sync-frm"
4256
tmpfs:
4357
- /var/lib/mysql
58+
- /tmp
4459
ports:
4560
- "127.0.0.1:3306:3306"
4661
healthcheck:

0 commit comments

Comments
 (0)