diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-06-12 10:35:21 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-06-12 10:35:21 +0200 |
commit | 805d32bd0f4ad0faef62db9c09c76dcc50c66464 (patch) | |
tree | 320363c67ab8ce9a0c312331c1d785d592946c13 | |
parent | 98e08c79b029cc435f1a6fb61f822c709a9fedaa (diff) | |
download | mariadb-git-805d32bd0f4ad0faef62db9c09c76dcc50c66464.tar.gz |
Bug#29044 - memory buddy allocator "unoptimal" memory handling
- add config param to have better behavior with large tables
-rw-r--r-- | storage/ndb/include/mgmapi/mgmapi_config_parameters.h | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 1 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 6 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp | 5 | ||||
-rw-r--r-- | storage/ndb/src/mgmsrv/ConfigInfo.cpp | 12 |
5 files changed, 26 insertions, 0 deletions
diff --git a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h index d0bd8be16a3..ac2cbf060fd 100644 --- a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -118,6 +118,8 @@ #define CFG_DB_O_DIRECT 168 +#define CFG_DB_MAX_ALLOCATE 169 + #define CFG_DB_SGA 198 /* super pool mem */ #define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */ diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index d59d5cd79f2..7845305da6c 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -2618,6 +2618,7 @@ private: ArrayPool<Page> c_page_pool; Uint32 cnoOfAllocatedPages; + Uint32 m_max_allocate_pages; Tablerec *tablerec; Uint32 cnoOfTablerec; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index f4fd80a482a..3a8e996d435 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -308,6 +308,12 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal) Uint32 noOfTriggers= 0; Uint32 tmp= 0; + + if (ndb_mgm_get_int_parameter(p, CFG_DB_MAX_ALLOCATE, &tmp)) + tmp = 32 * 1024 * 1024; + m_max_allocate_pages = (tmp + GLOBAL_PAGE_SIZE - 1) / GLOBAL_PAGE_SIZE; + + tmp = 0; ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE_RANGE, &tmp)); initPageRangeSize(tmp); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE, &cnoOfTablerec)); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp index 8493e0561cc..ed8f63ce3ad 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp @@ -434,6 +434,11 @@ void Dbtup::allocMoreFragPages(Fragrecord* const regFragPtr) // We will grow by 18.75% plus two more additional pages to grow // a little bit quicker in the beginning. /* -----------------------------------------------------------------*/ + + if (noAllocPages > m_max_allocate_pages) + { + noAllocPages = m_max_allocate_pages; + } Uint32 allocated = allocFragPages(regFragPtr, noAllocPages); regFragPtr->noOfPagesToGrow += allocated; }//Dbtup::allocMoreFragPages() diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp index 56aacda214d..229824c49bf 100644 --- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp @@ -1314,6 +1314,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { STR_VALUE(MAX_INT_RNIL) }, { + CFG_DB_MAX_ALLOCATE, + "MaxAllocate", + DB_TOKEN, + "Maximum size of allocation to use when allocating memory for tables", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "32M", + "1M", + "1G" }, + + { CFG_DB_MEMREPORT_FREQUENCY, "MemReportFrequency", DB_TOKEN, |