[erlang-questions] Linux O_DIRECT flag

Per Hedeland per@REDACTED
Sat Mar 15 02:23:44 CET 2008

Toby Thain <toby@REDACTED> wrote:
>On 14-Mar-08, at 5:14 PM, Valentin Micic wrote:
>> Not when your application starts to swap-in and out because it is  
>> running out of RAM,
>That should never happen!

At least not when you include the "few months ago" part - inactive
non-dirty pages are of course just tossed if RAM is needed for other
purposes - but there's no point in doing it earlier, which sometimes
leads to the newbie (sorry:-) question "Where has all my RAM gone?"

What *can* be a problem though is that *active* massive I/O operations
force other pages out to swap due to unrestricted cache growth - which
is why "some other" OSes implement some "push-back" mechanisms for the
cache, or in older times simply had a hard limit as percentage of RAM.

I don't know off-hand whether there is a way to make Linux do something
like that, but I would think so (at least the hard limit method, maybe
with a number calculated by the user) - but the default is AFAIK "give
the cache all it wants".

> Are you sure you've got the right analysis?

I would also doubt that, given the way the problem is presented. In any
case the O_DIRECT thing sounds like a performance disaster unless you
have an application that has been specifically designed with those
semantics in mind.

--Per Hedeland

More information about the erlang-questions mailing list