We apologize for @samold, "swappiness" has nothing to do with it. Swappiness only affects how the kernel trades when replacing dirty anonymous pages and crowding out the page cache when memory is low.
You need to play with Linux servers managing the pdflush task . To start, I would suggest:
sysctl -w vm.dirty_writeback_centisecs=360000
By default, vm.dirty_writeback_centisecs is 3000, which means that the kernel will consider any dirty page older than 30 seconds "too old" and try to clear it to disk. Scrolling it up to 1 hour, you should avoid washing dirty pages to disk generally, at least during a short test. With the exception of...
sysctl -w vm.dirty_background_ratio=80
By default, vm.dirty_background_ratio is 10, as is 10 percent. This means that when more than 10 percent of the physical memory is occupied by dirty pages, the kernel will think that it needs to take care of something on the disk, even if it is younger than dirty_writeback_centisecs . Raise this key to 80 or 90, and the kernel should agree to transfer most of the RAM occupied by dirty pages. (I would not put this too high, although since I'm sure no one ever does this, and this can cause strange behavior.) Except ...
sysctl -w vm.dirty_ratio=90
By default, vm.dirty_ratio is 40, which means that when 40% of the RAM is dirty pages, processes trying to create more dirty pages are blocked until something is evicted. Always do this more than dirty_background_ratio . Hmm, think about it, put it in front of it, just to make sure it's always more.
What is it for my initial suggestions. Perhaps your kernel will start to paginate pages anyway; Linux VM is a mysterious animal and seems to need to be tuned in every release. Hope this will be the starting point.
See Documentation / sysctl / vm.txt in kernel sources for a complete list of tunable virtual machines. (Preferably refer to the documentation for the kernel version that you are actually using.)
Finally, use the / proc / PID / pagemap interface to see which pages are actually dirty at any time.