I have a mysql database with 5.6.
-
Binary logs are enabled and it has 5 slaves.
-
GTID mode enabled.
-
Maximum binlog file size is 1GB.
-
sync_binlog = 0
When I check the free -gh
total used free shared buff/cache available
Mem: 117G 79G 1.4G 25M 37G 37G
Swap: 0B 0B 0B
37GB in Cache.
I wanted to check what are all related to Mysql. So I used fincore
and I could see from mysql-bin.000557
to mysql-bin.000590
are in the OS Cache.
Total Cache from binlog is 35GB.
Best Answer
Yes its expected behaviour. MySQL doesn't control what goes in the buff/cache, that's purely down to the OS. It gets reclaimed quite quickly on any new file access or process memory requirement.
Linux can't really tell its not going to be used again soon, but its not doing anything else with the memory so it just uses it (or more correctly, doesn't immediately purge it).