Skip to content
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

Fix to avoid premature exit #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mortan
Copy link

@mortan mortan commented Apr 10, 2015

Hi!

You should sync with the destination to avoid wrong measurement results.

No sync:
./fcopy /tmp/rbigfile.dat /tmp/wbigfile2.dat 2 0.00s user 0.24s system 99% cpu 0.242 total

0.242 seconds for a 1 GB file on a ~180MB/s hard disk...

grep Dirty /proc/meminfo
Dirty: 1048476 kB

There we go, dirty memory that isn't flushed yet to the disk!

After adding the fdatasync call:
./fcopy /tmp/rbigfile.dat /tmp/wbigfile2.dat 2 0.00s user 0.32s system 4% cpu 6.461 total

Regards!

@arturmkrtchyan
Copy link
Owner

Hi

Thanks for the pull request!

This is not about how fast is disc access etc... and I'm not flushing to disk in any example. So I guess comparison is fare enough. What do you think ?

Thanks,
Artur

@mortan
Copy link
Author

mortan commented Apr 10, 2015

Hi!

If you don't sync after the (zero copy) sendfile call the disk write gets queued (on my linux system) and you can't compare the execution time!

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants