Github user kocolosk commented on a diff in the pull request: https://github.com/apache/couchdb-couch/pull/185#discussion_r71254154 --- Diff: src/couch_file.erl --- @@ -524,6 +525,99 @@ handle_info({'EXIT', _, Reason}, Fd) -> {stop, Reason, Fd}. +%% first try to read header at end, falling back to chunked reads on failure +find_last_header(Fd, FileSize) -> + ok = file:advise(Fd, 0, FileSize, dont_need), % minimize disk cache pollution --- End diff -- I'm all for smarter use of `posix_fadvise`, but I'm confused about the advice being given here. On modern Linux systems doesn't this just tell the kernel to free all pages associated with this file descriptor? Were you trying to tell the kernel not to cache the reads that you do? I think that's the intention behind the `no_reuse` setting, but as far as I know it was never implemented and setting that flag is a noop.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---