Limit Disk Cache Size
My machine has 24 GB of memory and runs CentOS 6.4 64-bit. I'm having problems using /dev/shm. I think this is because the disk cache is filling up (see previous thread). I don't know how to fix it, but if I limit the disk cache size, then that's might work.
Does anyone know how to limit the size of the disk cache? |
You can change the size of /dev/shm on the fly with a command like this :
Quote:
You can display what is in /dev/shm with a 'df' command. |
I don't want to change the size of /dev/shm. I want to change the size of the disk cache. Why? Because the disk cache is getting too large and that is taking space away from /dev/shm. That prevents me from being able to use /dev/shm (and it prevents other apps from using /dev/shm, and those apps are crashing).
How can I decrease the size of the disk cache? Or, how can I prevent the disk cache taking space away from /dev/shm? I know that the disk cache is not supposed to take space away from other applications. Maybe this is true. But it is certainly taking space away from /dev/shm. So the disk cache is effectively taking memory space away from other applications. Thank you. |
Quote:
|
If its the buffers, and cache in memory, you may find this link useful.
-->http://www.unixmen.com/how-to-clear-...linux-servers/ |
Quote:
|
Quote:
|
Quote:
There are parameters in the kernel config that have an affect on buffers and cache. Quote:
I had a problem recently with /dev/shm in memory. I had problems compiling an application. The work around was to mount temp file space on a real hard drive partition, with adequate space. Once done, the app compiled. This is not an ideal solution for the long term though, since disk access is much slower than memory access. |
Okay, then forget disk cache. I think my issue is with the memory cache. The problem seems to be that when the memory cache gets close to the total size of physical memory, I can no longer use /dev/shm.
I did not upgrade the kernel recently, so that could not have caused this problem. This problem started about a month ago about the time I configured a software RAID with mdadm. Is it possible I changed something that caused the memory cache to behavior differently? I looked at every file in the /etc directory tree that changed during the past month. No files changed which had anything to do with the disk (other than possibly the mdadm config file). Where would be a good place to look for answers to this? I really need to be able to use /dev/shm. |
You might try reducing swappiness to increase the kernel's preference for throwing away cache pages when there are demands for memory.
|
Quote:
|
All times are GMT -5. The time now is 09:11 AM. |