mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for Bug#37408 - Compressed MyISAM files should not require/use mmap()
When compressed myisam files are opened, they are always memory mapped sometimes causing memory swapping problems. When we mmap the myisam compressed tables of size greater than the memory available, the kswapd0 process utilization is very high consuming 30-40% of the cpu. This happens only with linux kernels older than 2.6.9 With newer linux kernels, we don't have this problem of high cpu consumption and this option may not be required. The option 'myisam_mmap_size' is added to limit the amount of memory used for memory mapping of myisam files. This option is not dynamic. The default value on 32 bit system is 4294967295 bytes and on 64 bit system it is 18446744073709547520 bytes. Note: Testcase only tests the option variable. The actual bug has be to tested manually.
This commit is contained in:
@ -4975,7 +4975,8 @@ enum options_mysqld
|
||||
OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE,
|
||||
OPT_MAX_ERROR_COUNT, OPT_MULTI_RANGE_COUNT, OPT_MYISAM_DATA_POINTER_SIZE,
|
||||
OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
|
||||
OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
|
||||
OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_MMAP_SIZE,
|
||||
OPT_MYISAM_SORT_BUFFER_SIZE,
|
||||
OPT_MYISAM_STATS_METHOD,
|
||||
OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
|
||||
OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
|
||||
@ -6255,6 +6256,10 @@ The minimum value for this variable is 4096.",
|
||||
(gptr*) &max_system_variables.myisam_max_sort_file_size, 0,
|
||||
GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, (ulonglong) MAX_FILE_SIZE,
|
||||
0, 1024*1024, 0},
|
||||
{"myisam_mmap_size", OPT_MYISAM_MMAP_SIZE,
|
||||
"Can be used to restrict the total memory used for memory mmaping of myisam files",
|
||||
(gptr*) &myisam_mmap_size, (gptr*) &myisam_mmap_size, 0,
|
||||
GET_ULL, REQUIRED_ARG, SIZE_T_MAX, MEMMAP_EXTRA_MARGIN, SIZE_T_MAX, 0, 1, 0},
|
||||
{"myisam_repair_threads", OPT_MYISAM_REPAIR_THREADS,
|
||||
"Number of threads to use when repairing MyISAM tables. The value of 1 disables parallel repair.",
|
||||
(gptr*) &global_system_variables.myisam_repair_threads,
|
||||
|
Reference in New Issue
Block a user