Let’s measure how fast file operations are performed in docker:
- Volume exposed outside Windows container & Hyper-V isolation (default for Windows 10 Pro)
- File stored inside container without being exposed
- Local file on host machine without any visualization
The diskspd.exe Microsoft tool will generate load:
- Operate with 2GB file size
- A few seconds for warming-up and slowing-down
- Block size of 128K
- 4 threads
- Random reads
- Run test for 2 minutes
diskspd.exe -b128K -d120 -o16 -t4 -r -c2G -w60 -W2 -C2 filepath
No other resource-consuming activities were performed in the system during test.
The host Windows version is 1909:
Even though same hardware used inside/outside container, I’ll mention year-old SSD & 8 core CPU hardware used in benchmark.
Surprisingly, local file system is 10 times faster than one sitting inside container:
Disclaimer: At the moment of the article initial publish, I do not have a solid technical explanation why that happens. Detailed results could be found below.