Rob van der Heij wrote: >What we are seeing lately with some installations is that Linux >appears so eager to keep data in memory (i.e. data backed by files on >disk) that it starts to swap out processes. That does not seem to be >the right way...
It's not a simple either-or decision. In many cases, it is indeed preferable to keep frequently accessed file-backed pages, even at the cost of swapping out anonymous pages that haven't been touched in a long time. Linux tries to balance all its pages based on the access patterns, no matter whether they are file-backed or swap- backed. (B.t.w. to clarify: Linux doesn't 'swap out processes', it swaps on a page basis. Less frequently accessed pages will be singled out for swap.) There have been cases where the LRU heuristics can be fooled: e.g. if you quickly read once through a very large file (or multiple files with very large aggregate size), all these -very recently accessed- pages can flush out many older pages, even though you actually won't access those file pages again -- which Linux doesn't know. These cases can be tuned to some extent by using the fadvise/ madvise calls to inform the kernel of the intended read-once pattern. AFAIK the 2.6 kernel also has a read-once detection heuristic of some kind, though I'm not sure how reliable that one is ... Mit freundlichen Gruessen / Best Regards Ulrich Weigand -- Dr. Ulrich Weigand Linux for S/390 Design & Development IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen Phone: +49-7031/16-3727 --- Email: [EMAIL PROTECTED] ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390