Skip to content

Document that directio does not apply to cached files#259

Open
climagabriel wants to merge 1 commit intonginx:mainfrom
climagabriel:docs-directio-no-cache-files
Open

Document that directio does not apply to cached files#259
climagabriel wants to merge 1 commit intonginx:mainfrom
climagabriel:docs-directio-no-cache-files

Conversation

@climagabriel
Copy link
Copy Markdown

@climagabriel climagabriel commented Apr 17, 2026

directio only works for static content in Nginx. It's by design.
So everything we serve from disk cache passes through the page cache and always has.

Motivation

People routinely assume directio applies to cache files, which it currently doesn't. They enable it expecting a decline in page cache pressure or memory pressure and are confused to see no change at all.

Related: nginx/nginx#654. freenginx has since added it — see freenginx 306b71004f29 ("Cache: directio support when reading cache files") and the follow-up 6afd081c554e ("Open file cache: correct directio handling with threads").

Users commonly assume directio takes effect for files served from
proxy_cache (the most widespread nginx deployment), and configure it
expecting reduced page cache pressure on the cache path. It does not:
cached responses are served through buffered I/O regardless of the
directive. See nginx/nginx#654 for context.
@climagabriel climagabriel force-pushed the docs-directio-no-cache-files branch from b2f7e62 to 4ab25d6 Compare April 17, 2026 08:00
@climagabriel
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant