sapling/eden/fs/utils
Xavier Deguillard f2e7099799 nfs: allow mountd and nfsd to bind to a unix socket on macOS
Summary:
Due to NFS being designed as a network filesystem, it default to binding on a
TCP socket. For EdenFS, since we're not expecting to mount an actual remote
filesystem, we bind these sockets to localhost. Unfortunately, TCP sockets have
some inherent overhead due to being designed to be reliable over a non-reliable
medium.

On macOS, Apple provides a way to mount an NFS server that is listening on a
unix domain socket. Thanks for unix socket being reliable, the TCP overhead
goes away leading to some higher throughput and lower latency for the NFS
server. For EdenFS, timing `rg foobar` over a directory containing 27k files gives:

NFS over TCP:
rg foobar > /dev/null  0.80s user 5.44s system 567% cpu 1.100 total

NFS over UDS:
rg foobar > /dev/null  0.77s user 5.27s system 679% cpu 0.888 total

osxfuse:
rg foobar > /dev/null  0.87s user 5.59s system 662% cpu 0.975 total

The main drawback of going through a unix socket is that D27717945 (bcf6aa465c) appears to
no longer be effective due to
8f02f2a044/bsd/nfs/nfs_vfsops.c (L3739)

Reviewed By: kmancini

Differential Revision: D28261422

fbshipit-source-id: 25dc1dc78cdb50d6c6550a86ef01ea2c894c110f
2021-05-12 13:06:57 -07:00
..
test utils: add a semi() method to ImmediateFuture 2021-05-11 08:05:11 -07:00
BucketedLog.h remove dependency on glog 2020-11-10 16:31:15 -08:00
BufVec.h fuse: move BufVec.h to utils/ 2020-09-02 12:15:48 -07:00
Bug.cpp refactor the EDEN_BUG() macro 2019-11-22 15:38:33 -08:00
Bug.h Remove folly's ColdClass, which was of dubious utility 2020-01-09 13:09:56 -08:00
CaseSensitivity.h utils: introduce CaseSensitivity 2021-04-20 13:08:27 -07:00
ChronoParse.cpp Replace Folly Format with fmt in logger to reduce binary size 2019-11-18 05:53:08 -08:00
ChronoParse.h Tidy up license headers 2019-10-11 05:28:23 -07:00
ChronoUnit.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
ChronoUnit.gperf update license header in remaining files 2019-06-19 17:02:46 -07:00
ChronoUnit.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Clock.cpp utils: remove UnixClock::getElapsedTimeInNs 2020-09-30 15:50:08 -07:00
Clock.h utils: remove UnixClock::getElapsedTimeInNs 2020-09-30 15:50:08 -07:00
CMakeLists.txt utils: add stack trace for Windows 2021-04-23 13:20:46 -07:00
CoverageSet.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
CoverageSet.h Tidy up license headers 2019-10-11 05:28:23 -07:00
DirType.cpp assert that the dtype constants have consistent values on all platforms 2020-04-28 13:23:52 -07:00
DirType.h utils: define symlink type for Windows 2021-04-29 13:17:54 -07:00
EdenError.cpp move EdenError to utils/ 2021-02-23 19:58:03 -08:00
EdenError.h move EdenError to utils/ 2021-02-23 19:58:03 -08:00
EnumValue.h add enumValue utility function 2020-04-28 17:41:24 -07:00
FaultInjector.cpp build deprecation-clean 2019-11-12 16:31:54 -08:00
FaultInjector.h Tidy up license headers 2019-10-11 05:28:23 -07:00
FileDescriptor.cpp Apply clang-format update fixes 2021-01-10 10:06:29 -08:00
FileDescriptor.h eden: introduce SpawnedProcess 2020-09-01 13:31:32 -07:00
FileUtils.cpp utils: truncate nul bytes after obtaining a temp file name 2020-10-22 16:24:17 -07:00
FileUtils.h win: move win/utils onto utils/ 2020-09-22 09:09:56 -07:00
Future.h add a collectSafe function 2020-02-03 11:30:50 -08:00
FutureUnixSocket.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
FutureUnixSocket.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Guid.h win: re-use guid for the lifetime of the checkout 2020-12-15 08:07:49 -08:00
Handle.h remove dependency on glog 2020-11-10 16:31:15 -08:00
IDGen.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
IDGen.h Tidy up license headers 2019-10-11 05:28:23 -07:00
ImmediateFuture-inl.h utils: add a semi() method to ImmediateFuture 2021-05-11 08:05:11 -07:00
ImmediateFuture-pre.h utils: add an ImmediateFuture type 2021-05-06 10:54:03 -07:00
ImmediateFuture.h utils: add a semi() method to ImmediateFuture 2021-05-11 08:05:11 -07:00
IoFuture.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
IoFuture.h Tidy up license headers 2019-10-11 05:28:23 -07:00
LazyInitialize.h Tidy up license headers 2019-10-11 05:28:23 -07:00
LeaseCache.h Tidy up license headers 2019-10-11 05:28:23 -07:00
MappedDiskVector.h fix compilation error of missing type 2021-03-15 22:31:25 -07:00
Memory.cpp introduce an assertZeroBits function to double-check the compiler 2020-09-13 01:37:14 -07:00
Memory.h introduce an assertZeroBits function to double-check the compiler 2020-09-13 01:37:14 -07:00
NfsSocket.cpp nfs: allow mountd and nfsd to bind to a unix socket on macOS 2021-05-12 13:06:57 -07:00
NfsSocket.h nfs: allow mountd and nfsd to bind to a unix socket on macOS 2021-05-12 13:06:57 -07:00
NotImplemented.h move EdenError to utils/ 2021-02-23 19:58:03 -08:00
PathFuncs.cpp utils: expand AbsolutePathBase to provide some filesystem related methods via Boost 2021-04-23 15:22:09 -07:00
PathFuncs.h utils: expand AbsolutePathBase to provide some filesystem related methods via Boost 2021-04-23 15:22:09 -07:00
PathMap.h utils: introduce CaseSensitivity 2021-04-20 13:08:27 -07:00
Pipe.cpp eden: introduce FileDescriptor and Pipe types 2020-09-01 13:31:32 -07:00
Pipe.h eden: introduce FileDescriptor and Pipe types 2020-09-01 13:31:32 -07:00
ProcessAccessLog.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
ProcessAccessLog.h remove dependency on glog 2020-11-10 16:31:15 -08:00
ProcessNameCache.cpp make msvc happy 2021-04-13 14:34:41 -07:00
ProcessNameCache.h utils: compile ProcessAccessLog and ProcessNameCache on Windows 2020-09-04 16:14:25 -07:00
ProcUtil.cpp Remove dead includes in eden 2020-10-09 15:25:47 -07:00
ProcUtil.h utils: add a platform independent FileUtils 2020-08-14 18:56:33 -07:00
Rcu.h utils: add an RcuPtr class 2020-12-11 14:10:58 -08:00
SortedInsert.h Tidy up license headers 2019-10-11 05:28:23 -07:00
SpawnedProcess.cpp use getGlobalIOExecutor instead of getIOExecutor 2021-04-21 22:13:53 -07:00
SpawnedProcess.h eden: introduce SpawnedProcess 2020-09-01 13:31:32 -07:00
SSLContext.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
SSLContext.h Tidy up license headers 2019-10-11 05:28:23 -07:00
StatTimes.h eden: add stattimes helpers for win32 2020-04-24 15:57:27 -07:00
StringConv.cpp utils: move multibyteToWideString to a cpp file 2020-09-30 16:29:13 -07:00
StringConv.h utils: move multibyteToWideString to a cpp file 2020-09-30 16:29:13 -07:00
Synchronized.h Tidy up license headers 2019-10-11 05:28:23 -07:00
SystemError.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Thread.cpp fs: ifdef linux/macos only files 2020-09-23 12:20:41 -07:00
Thread.h disable pthread cancellation on the FuseChannel threads 2020-05-08 20:41:50 -07:00
TimeUtil.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
TimeUtil.h Tidy up license headers 2019-10-11 05:28:23 -07:00
UnboundedQueueExecutor.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
UnboundedQueueExecutor.h Tidy up license headers 2019-10-11 05:28:23 -07:00
UnixSocket.cpp remove dependency on glog 2020-11-10 16:31:15 -08:00
UnixSocket.h edenfs: remove use of fork from StartupLogger 2020-09-18 17:22:39 -07:00
UserInfo.cpp win: move win/utils onto utils/ 2020-09-22 09:09:56 -07:00
UserInfo.h eden: use SpawnedProcess to start privhelper 2020-09-18 17:22:39 -07:00
Utf8.cpp utils: add a constexpr utf8 checker 2020-12-16 01:03:32 -08:00
Utf8.h utils: add a constexpr utf8 checker 2020-12-16 01:03:32 -08:00
WinError.cpp Back out "prjfs: handle concurrent file/directory removal" 2020-12-10 07:42:38 -08:00
WinError.h edenfs: move WinError to eden/fs/utils 2020-09-17 09:08:58 -07:00
WinStackTrace.cpp utils: add stack trace for Windows 2021-04-23 13:20:46 -07:00
WinStackTrace.h utils: add stack trace for Windows 2021-04-23 13:20:46 -07:00
XAttr.cpp fs: ifdef linux/macos only files 2020-09-23 12:20:41 -07:00
XAttr.h Tidy up license headers 2019-10-11 05:28:23 -07:00