Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions awscrt/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,19 @@ class S3FileIoOptions:
direct_io: bool = False
"""
Enable direct IO to bypass the OS cache. Helpful when the disk I/O outperforms the kernel cache.
Notes:
- Only supported on linux for now.
- Only supports upload for now.

- Currently only Linux supports direct I/O. On unsupported platforms, the request transparently
falls back to buffered I/O and a warning is logged.
- Supported for both upload (send_filepath) and download (recv_filepath).
- For upload, part_size MUST be page-aligned when direct_io is enabled (hard fail otherwise).
The client controls part_size and is responsible for ensuring alignment.
- For download, this is a best-effort optimization. The request transparently falls back to
buffered I/O (logging a warning) if any of the following preconditions are not met:
part_size is not page-aligned, recv_file_position is not page-aligned (WRITE_TO_POSITION),
existing file size is not page-aligned (CREATE_OR_APPEND), or the last part has an
unaligned length (only that part falls back).
- Check NOTES for O_DIRECT for additional info https://man7.org/linux/man-pages/man2/openat.2.html

In summary, O_DIRECT is a potentially powerful tool that should be used with caution.
"""

Expand Down
2 changes: 1 addition & 1 deletion crt/aws-lc
Loading