I would describe your problem this way:
You are writing a lot of buffers to disk. By using sync you are forcing the cache to write dirty buffers to disk fast enough so that there are very few, if any, present in the cache. However once a dirty buffer is written to disk it is kept in the cache as a clean buffer. Your memory is filling up with clean buffers which you know you will never need to satisfy a read request.
I think that you can change /proc/sys/vm/bdflush with the following command:
echo "30 500 0 0 500 3000 60 20 0" > /proc/sys/vm/bdflush
which I think will set it to the same values as your post shows.
So I would experiment with changing /proc/sys/vm/bdflush. The first thing that I would experiment with is:
2: 0 Num of clean buffers to be loaded onto free list by refill_freelist
and see if you can remove large numbers of clean buffers from the cache. Perhaps:
echo "30 500 500 0 500 3000 60 20 0" > /proc/sys/vm/bdflush
to see if every time you write dirty buffers then you immediately add the same number of clean buffers to the free list.
Of course, any such experiments should be done in a testing environment since you will probably knock Linux down many times before you find out whether this is a workable solution. This experiment may also corrupt your filesystem if it causes Linux to not write dirty buffers that it should write, so run your experiments against a partition that you can afford to reformat after a failed experiment.
___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html
Steve Stites