Ticket #2048 (closed defect: fixed)
Linux - Disk I/O performance problems
|Reported by:||decoder||Owned by:|
|Version:||VirtualBox 1.6.4||Keywords:||I/O performance disk|
I am running VirtualBox 1.6.4 on a Linux system with a Linux guest. I did I/O performance tests with the following setup:
- I created a 4 GB file on the root filesystem of the guest (called test.file) with dd from /dev/zero
- I ran "dd if=/dev/zero of=/test.file bs=4M count=1000 conv=notrunc"
- I ran "dd if=/dev/zero of=/test.file bs=4M count=1000 conv=notrunc oflag=direct"
So both commands overwrite the existing file without truncating it, the second command uses direct I/O for this task.
The results are as follows:
dd if=/dev/zero of=/test.file bs=4M count=1000 conv=notrunc & 1000+0 records in 1000+0 records out 4194304000 bytes (4.2 GB) copied, 416.406 s, 10.1 MB/s dd if=/dev/zero of=/test.file bs=4M count=1000 conv=notrunc oflag=direct & 1000+0 records in 1000+0 records out 4194304000 bytes (4.2 GB) copied, 108.356 s, 38.7 MB/s
As one can see, the first command (normal I/O) is very slow, whereas direct I/O is resonably fast. Is there any explanation for this behavior? As far as I know, direct I/O circumvents buffering in the linux kernel, so there must be a performance bottleneck somewhere making normal I/O really slow.
The underlying filesystems are all ext3, and the selected disk controller is SATA if that is important :)