System Administration
Showing results for 
Search instead for 
Did you mean: 

Limit Buffer Cache on Linux?

Go to solution
Honored Contributor

Limit Buffer Cache on Linux?

I am benchmarking an 8-socket, 6-core 256GB RAM Linux Big Iron. Running RHEL 5.3.

Is there a way to limit cache memory to a fixed value instead of the OS trying to gobble up as much memory and use it for cache?

The server has only 1 DB Instance running, 32GB SGA and roughly 232GB is showed as being used as "buffers" leaving only about 8GB "free" memory.

Hakuna Matata.
Ivan Ferreira
Honored Contributor

Re: Limit Buffer Cache on Linux?

As far I know, there is no option in 2.6 kernels to limit the pagecache as was available in 2.2 kernels (vm.pagecache).
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
John Poff
Honored Contributor

Re: Limit Buffer Cache on Linux?

Why bother? Why not just let the kernel manage the free memory?

We have a couple of boxes like that, one for test and one for production. Our DBAs set the SGA and we just let it fly. The kernel will give up the memory when the database needs it.

dirk dierickx
Honored Contributor

Re: Limit Buffer Cache on Linux?

what is it with people and their fixation about buffers/cache!!

leave it be! if the application requests this memory linux will happily clear it's buffers and give it to the app.

in the mean time, it looks like it doesn't need it and buffers can be assigned speeding everything up AND all that memory is being used, which is great!

all this comes at no _negative_ performance hit.
Goran Koruga
Honored Contributor

Re: Limit Buffer Cache on Linux?

See if vm.swappiness will help:

Steven E. Protter
Exalted Contributor

Re: Limit Buffer Cache on Linux?


It is totally unnecessary to limit the buffer cache on Linux.

Those of us with HP-UX experience know that taking memory out of buffer cache there is a big deal and can cripple a system. That is why we lock down dbc_max_pct and dbc_min_pct and sometimes put them to the same number to avoid that performance hit.

RH Linux can move memory in and out of the buffer cache without a performance hit. Leaving the memory in the buffer cache improves performance while its there and there is little or no delay in allocating that memory to a new Oracle Instance or any other purpose.

I think of Buffer cache memory as available memory because I can access it quickly with no penalty.

Steven E Protter
Owner of ISN Corporation