Skip to content

Commit 37322e4

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Try to reduce mysql memory usage"
2 parents 8adb83a + 7567359 commit 37322e4

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎.zuul.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@
696696
description: |
697697
Simple multinode test to verify multinode functionality on devstack side.
698698
This is not meant to be used as a parent job.
699+
vars:
700+
devstack_localrc:
701+
MYSQL_REDUCE_MEMORY: true
699702

700703
# NOTE(ianw) Platform tests have traditionally been non-voting because
701704
# we often have to rush things through devstack to stabilise the gate,

‎lib/databases/mysql‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ function configure_database_mysql {
176176
count INT, PRIMARY KEY (db, op)) ENGINE MEMORY" stats
177177
fi
178178

179+
if [[ "$MYSQL_REDUCE_MEMORY" == "True" ]]; then
180+
iniset -sudo $my_conf mysqld read_buffer_size 64K
181+
iniset -sudo $my_conf mysqld innodb_buffer_pool_size 16M
182+
iniset -sudo $my_conf mysqld thread_stack 192K
183+
iniset -sudo $my_conf mysqld thread_cache_size 8
184+
iniset -sudo $my_conf mysqld tmp_table_size 8M
185+
iniset -sudo $my_conf mysqld sort_buffer_size 8M
186+
iniset -sudo $my_conf mysqld max_allowed_packet 8M
187+
fi
188+
179189
restart_service $MYSQL_SERVICE_NAME
180190
}
181191

‎stackrc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ DATABASE_QUERY_LOGGING=$(trueorfalse False DATABASE_QUERY_LOGGING)
201201
# performance_schema that are of interest to us
202202
MYSQL_GATHER_PERFORMANCE=$(trueorfalse True MYSQL_GATHER_PERFORMANCE)
203203

204+
# This can be used to reduce the amount of memory mysqld uses while running.
205+
# These are unscientifically determined, and could reduce performance or
206+
# cause other issues.
207+
MYSQL_REDUCE_MEMORY=$(trueorfalse False MYSQL_REDUCE_MEMORY)
208+
204209
# Set a timeout for git operations. If git is still running when the
205210
# timeout expires, the command will be retried up to 3 times. This is
206211
# in the format for timeout(1);

0 commit comments

Comments
 (0)