Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a backup process which reads quite a lot of data from disk, and therefore uses up all memory for disk cache, swapping off apps and other cached data in the process. There is no benefit to keep backuped data in disk cache after the backup is finished, so I'd like to limit the amount of data which could be cached by kernel for that process. Is it possible?

Thanks,

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Fix the backup process so that it opens files with O_DIRECT, or so that it regularly calls posix_fadvise(..., POSIX_FADV_DONTNEED) when it's done with a block of data.

Or complain to whoever is responsible for the backup program to fix it per the above.

Alternatively, you can make a filter library which does the above and LD_PRELOAD that library when running the backup process.

share|improve this answer
1  
Thank you for starting points. To extend your answer a bit: I use duplicity and rdiff-backup, both of them use rsync internally. There's a ticket and some patches to implement it, and some non-official builds with a patch are provided. There's also a LD_PRELOAD way done by Andrew Morton. –  liori Jan 2 '12 at 18:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.