From 466272e0434f04f6bb95a1a4fec77c15308da203 Mon Sep 17 00:00:00 2001 From: inaam Date: Mon, 20 Jul 2009 15:23:15 +0000 Subject: [PATCH] branches/zip Change the read ahead parameter name to innodb_read_ahead_threshold. Change the meaning of this parameter to signify the number of pages that must be sequentially accessed for InnoDB to trigger a readahead request. Suggested by: Ken --- buf/buf0rea.c | 3 ++- handler/ha_innodb.cc | 12 +++++------- include/srv0srv.h | 2 +- srv/srv0srv.c | 10 ++++------ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/buf/buf0rea.c b/buf/buf0rea.c index aa4ff359219..319d6b2a522 100644 --- a/buf/buf0rea.c +++ b/buf/buf0rea.c @@ -485,7 +485,8 @@ buf_read_ahead_linear( /* How many out of order accessed pages can we ignore when working out the access pattern for linear readahead */ - threshold = ut_min(srv_read_ahead_factor, BUF_READ_AHEAD_AREA); + threshold = ut_min((64 - srv_read_ahead_threshold), + BUF_READ_AHEAD_AREA); fail_count = 0; diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index d2acb78a2e3..b71a06894e1 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -9950,13 +9950,11 @@ static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering, innodb_change_buffering_validate, innodb_change_buffering_update, NULL); -static MYSQL_SYSVAR_ULONG(read_ahead_factor, srv_read_ahead_factor, +static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold, PLUGIN_VAR_RQCMDARG, - "Number of pages that may be accessed out of order and InnoDB " - "will still issue a readahead." - "The higher the value the more relaxed the condition for starting " - "readahead.", - NULL, NULL, 8, 0, 64, 0); + "Number of pages that must be accessed sequentially for InnoDB to" + "trigger a readahead.", + NULL, NULL, 56, 0, 64, 0); static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), @@ -10010,7 +10008,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(version), MYSQL_SYSVAR(use_sys_malloc), MYSQL_SYSVAR(change_buffering), - MYSQL_SYSVAR(read_ahead_factor), + MYSQL_SYSVAR(read_ahead_threshold), MYSQL_SYSVAR(io_capacity), NULL }; diff --git a/include/srv0srv.h b/include/srv0srv.h index 6439f47d7a9..499bccfe2b8 100644 --- a/include/srv0srv.h +++ b/include/srv0srv.h @@ -161,7 +161,7 @@ extern ulint srv_mem_pool_size; extern ulint srv_lock_table_size; extern ulint srv_n_file_io_threads; -extern ulong srv_read_ahead_factor; +extern ulong srv_read_ahead_threshold; extern ulint srv_n_read_io_threads; extern ulint srv_n_write_io_threads; diff --git a/srv/srv0srv.c b/srv/srv0srv.c index adb578fb2af..79fa08e7cdf 100644 --- a/srv/srv0srv.c +++ b/srv/srv0srv.c @@ -209,12 +209,10 @@ UNIV_INTERN ulint srv_n_file_io_threads = ULINT_MAX; UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX; UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX; -/* User settable value of the number of pages that InnoDB will tolerate -within a 64 page extent even if they are accessed out of order or have -not been accessed at all. This number (which varies from 0 to 64) is -indicative of the slack that we have when deciding about linear -readahead. */ -UNIV_INTERN ulong srv_read_ahead_factor = 8; +/* User settable value of the number of pages that must be present +in the buffer cache and accessed sequentially for InnoDB to trigger a +readahead request. */ +UNIV_INTERN ulong srv_read_ahead_threshold = 56; #ifdef UNIV_LOG_ARCHIVE UNIV_INTERN ibool srv_log_archive_on = FALSE;