I am running a server with 24G of RAM. The only thing running here is a MySQL server configured as Master.
When I check the memory via free -m I am getting this:
total used free shared buffers cached
Mem: 24158 24027 131 0 131 23050
Approx. 23G is in cache. Which seems a lot to me.
I also set caching to 0 in the my.cnf
query_cache_size = 0
How can I check what is exactly cached?
Also a restart of mysql doesn't clear the cache. A flush tables
also didn't help.
Answer
You're looking at two different caches. free -m
tells you how much memory the operating system is using for the disk cache, not how much MySQL is using for the database cache. And the operating system should be using as much memory as it can for the disk cache -- why wouldn't you want as big a cache as possible? That memory is always available to be used if an application needs it. See here for a good discussion of Linux memory usage for caching.
Comments
Post a Comment