-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use DirectIO for sampling #101
Comments
A library for Go can be found https://github.com/ncw/directio |
A quick test with Macos (16GB RAM) on an external disk (APFS)
Trying to do more research and test on the reason why this is counter-intuitive. |
Hi Qi, what exactly is the fio command used in this test? |
It will be great to include the testing result that fio directIO/no-directIO ran (also the fio command you were using) with the same config in your test env |
Also you'd better clarify the testing result was based on the PR (#121), right? |
Running on my Mac M2 with APFS + USBC 4.0 + Fanxiang S880
fio reports 1.2GB/s, activity monitor reports 1.2GB/s
fio reports 700MB/s, activity monitor reports 2.6GB/s |
The performance is closely related to the USB interface. For example, using the above commands with Samsung 990 Pro, I have
Using another USBC4.0 + 990 Pro, I have
|
Test with exactly fio commands with the following hardware:
read with 64 threads (direct=1)
read with 64 threads (direct=0)
No big difference has been observed. Could it be that the USB 3.2 capacity has already been reached? |
Another round of tests with local APPLE SSD(APFS) and a file of size 256GB, with the same commands. read with 64 threads (direct=1)
read with 64 threads (direct=0)
Could see a little better with direct=1. |
A simple sampling test using "github.com/ncw/directio" with local APPLE SSD(APFS) and a file of size 256GB. dl@MBPDL directio % ./directio -f=256GB
Start random sampling from file 256GB with 12 threads for 12 seconds long, NOT using DirectIO
File size: 274877906944
Total sampling times: 1011599
dl@MBPDL directio % ./directio -f=256GB -d
Start random sampling from file 256GB with 12 threads for 12 seconds long, using DirectIO
File size: 274877906944
Total sampling times: 1000256 If the test code makes sense, DirectIO does not seem faster than non-directIO. |
what is the stat that activity monitor reported, was it the same as the stats above? |
Observed activity monitor when repeating the above tests, in both cases (using DirectIO and NOT using DirectIO) the |
I can reproduce similar result on the m3 MBP in the office. direct = 1 direct =0 |
es-node test result on the m3 MBP: main branch: (direct =0) directUI branch: (direct =1) |
The test result of the go sampling test code:
|
606301 * 4 * 1024 / 12 = 206 MB/s, and it is much lower than the activity monitor reported 1.02 GB/s. We may need to find out where did the overhead come from |
Since it is not the main expected users' scenario, we can remove it from the milestone 3 |
Yes, I think we can optimize it later. |
DirectIO will bypass OS buffer, where buffering is unnecessary in our sampling process. Further, it seems that DirectIO will be faster on some FS such as APFS. E.g., using 32 threads sampling on APFS, DirectIO can yield 1GB/s randread (actual disk IO is 1GB/s), while buffer IO will yield 500GB/s (actual disk IO is 2GB/s, no sure where the overhead comes from).
The text was updated successfully, but these errors were encountered: