Date: Tue, 10 Jan 2012 17:28:09 -0500 From: "Mikhail T." <mi+thun@aldan.algebra.com> To: fs@freebsd.org Subject: How to best send files over network? Message-ID: <4F0CBB79.7010704@aldan.algebra.com>
next in thread | raw e-mail | index | archive | help
Hello! I'm trying to implement a BSD-tuned sending of files. Most of the files are fairly large. I thought, sendfile(2) is the way to go, but, it seems, there are severe performance problems at the moment for the files located on a ZFS. mmap-ing the files and then write-ing them is claimed to be a lot faster. Could somebody comment on this? Should one always mmap/write, or are there situations, when sendfile is advantageous? If, indeed, sendfile is best for UFS, but mmap/write is better over ZFS, what is the best way to determine the underlying FS for each file? statfs(2) is supposed to answer that question -- what should I look for in the struct statfs, that it will return? Do I check, if f_fsid contains a magic number for ZFS, or look for a magic string in f_fstypename? Could someone provide an example? Thank you very much. Yours, -mi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F0CBB79.7010704>