Bug #68724 Please expose myisam_mmap_used and make myisam_mmap_size dynamic
Submitted: 20 Mar 2013 7:10 Modified: 20 Mar 2013 9:13
Reporter: Simon Mudd (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Options Severity:S4 (Feature request)
Version:5.6.10 OS:Any
Assigned to: CPU Architecture:Any

[20 Mar 2013 7:10] Simon Mudd
Description:
There's a variable which allows you to configure the maximum mmap() memory size for mmaped compressed MyISAM tables, yet as far as I know there's no way to see what the current usage is.

The variable for the size configuration is also static rather than dynamic.

How to repeat:
mysql> show global status like '%mmap%';
Empty set (0.00 sec)

mysql> show global variables like 'myisam_mmap_size';
+------------------+----------------------+
| Variable_name    | Value                |
+------------------+----------------------+
| myisam_mmap_size | 18446744073709551615 |
+------------------+----------------------+
1 row in set (0.01 sec)

mysql> set global myisam_mmap_size = 50000;
ERROR 1238 (HY000): Variable 'myisam_mmap_size' is a read only variable
mysql> 

Suggested fix:
On a server with a large number of such mmap'd tables it would be useful to be able to see the setting myisam_mmap_used.

So please expose this setting via SHOW GLOBAL STATUS so it can be seen.

myisam_mmap_size is a static setting which means that any desire to change this is impossible without shutting down MySQL. In busy environments this is inconvenient and making the variable dynamic would allow for a change to be made without restarting the server. That is good.

If necessary, and to simplify the implementation only make the change succeed if the new myisam_mmap_size > myisam_mmap_used, as this only requires a variable's value to be changed, and the DBA can FLUSH TABLES to free up the currently used size if needed to bring the size down to 0.
[20 Mar 2013 9:13] MySQL Verification Team
Duplicated of:

Bug 11762467 - PROVIDE STATUS VARIABLE TO SHOW CURRENT MYISAM_MMAP_USED
http://bugs.mysql.com/bug.php?id=55066