High-performance IO
- From: "Piotr Wyderski" <wyderski@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 23 Jul 2006 13:35:13 +0200
I would like to obtain the highest possible throughput
of disk IO under the following conditions. The program simultaneously reads and writes several large files,
~0.25+ GiB each. Each file must be processed in order,
so no explicit fine-grained parallelization provided by IOCP
is possible -- the file has its own processing thread. The
files are accessed sequentially and only once, so no caching
will help. Currently I use four independent memory buffers
per file and overlapped IO to separate the phases of
reading/writing and processing. The IO completion notifications
are issued through Win32 event objects.
I set the FILE_FLAG_NO_BUFFERING flag to bypass
the filesystem cache and (hopefully) cause the system to
perform explicit DMA transfers directly into the buffers.
But several questions remain open:
1. How big should be the data block to obtain the highest
performance? Currently it is hardcoded to 512KiB, but it
is an early implementation and is subject to change. If
it is OS/filesystem specific, then how can I get the best
value at run time using WinAPI?
2. Does FILE_FLAG_NO_BUFFERING and FILE_FLAG_OVERLAPPED interfere somehow
with FILE_FLAG_SEQUENTIAL_SCAN?
Should I avoid the latter hint when the first two flags
are specified?
3. How should I allocate the memory buffer? A simple
VirtualAlloc will do, but it can optimize (cache coloring,
clustering etc.) the virtual->physical address mapping
for memory access, not for IO, especially for large DMA
transfers. Is there a way to allocate a contiguous block of
physical memory? Will it help much under NT/XP? I'm
asking, because I don't know the details of NT's low-level
disk IO architecture and implementation.
4. Can I directly read into/write from an AWE buffer?
5. Is there something I forgot to use in order to obtain
the highest throughput? Except IOCP, of course. :-)
Best regards
Piotr Wyderski
.
- Follow-Ups:
- Re: High-performance IO
- From: anton bassov
- Re: High-performance IO
- From: Hector Santos
- Re: High-performance IO
- From: Scott McPhillips [MVP]
- Re: High-performance IO
- From: anton bassov
- Re: High-performance IO
- Prev by Date: STARTUPINFO is not working ?
- Next by Date: STARTUPINFO is not working ?
- Previous by thread: STARTUPINFO is not working ?
- Next by thread: Re: High-performance IO
- Index(es):
Relevant Pages
|
Loading