Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-31953 madvise(..., MADV_FREE) is causing a performance regression / MDEV-24670 avoid OOM by linux kernel co-operative memory management #2805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions mysql-test/suite/innodb/r/mem_pressure.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# MDEV-24670 avoid OOM by linux kernel co-operative memory management
#
set @save_dbug=@@debug_dbug;
set @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
set @save_lag_wait=@@GLOBAL.innodb_max_purge_lag_wait;
set GLOBAL innodb_max_purge_lag_wait=0;
CREATE TABLE t1 (t TEXT) ENGINE=InnoDB;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET unique_checks=0, foreign_key_checks=0;
INSERT INTO t1 SELECT CONCAT(REPEAT('junk text', 500), CAST(seq AS CHAR)) FROM seq_1_to_1000;
SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SET GLOBAL innodb_max_purge_lag_wait=@save_lag_wait;
DROP TABLE t1;
SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
set debug_dbug="d,trigger_garbage_collection";
grooverdan marked this conversation as resolved.
Show resolved Hide resolved
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size;
grooverdan marked this conversation as resolved.
Show resolved Hide resolved
SELECT CAST(VARIABLE_VALUE AS INTEGER) < @dirty_prev AS LESS_DIRTY_IS_GOOD
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
LESS_DIRTY_IS_GOOD
1
FOUND 1 /InnoDB: Memory pressure event freed/ in mysqld.1.err
set debug_dbug=@save_dbug;
# End of 10.11 tests
44 changes: 44 additions & 0 deletions mysql-test/suite/innodb/t/mem_pressure.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--source include/have_debug.inc
--source include/linux.inc
--source include/not_embedded.inc
dr-m marked this conversation as resolved.
Show resolved Hide resolved
--source include/have_innodb.inc
--source include/have_sequence.inc

--echo #
--echo # MDEV-24670 avoid OOM by linux kernel co-operative memory management
--echo #

set @save_dbug=@@debug_dbug;

set @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
set @save_lag_wait=@@GLOBAL.innodb_max_purge_lag_wait;
set GLOBAL innodb_max_purge_lag_wait=0;

CREATE TABLE t1 (t TEXT) ENGINE=InnoDB;
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET unique_checks=0, foreign_key_checks=0;
INSERT INTO t1 SELECT CONCAT(REPEAT('junk text', 500), CAST(seq AS CHAR)) FROM seq_1_to_1000;

SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SET GLOBAL innodb_max_purge_lag_wait=@save_lag_wait;

DROP TABLE t1;

SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';

set debug_dbug="d,trigger_garbage_collection";
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size;

SELECT CAST(VARIABLE_VALUE AS INTEGER) < @dirty_prev AS LESS_DIRTY_IS_GOOD
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';

let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= InnoDB: Memory pressure event freed;
--source include/search_pattern_in_file.inc

set debug_dbug=@save_dbug;

--echo # End of 10.11 tests
Loading