Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当从磁盘读取并通过网络写入文件以获得最佳速度时,正确的 fcntl 标志是什么?
也许问题出在文件描述符上设置的 fcntl 标志上?
我认为不会fcntl为您提供任何会影响性能的东西。也许您正在寻找posix_fadvise,但我认为主要的关键是使用相当大的缓冲区。
fcntl
posix_fadvise
我假设您正在使用 NFS(或类似的东西)通过网络读取/写入文件。最好的选择是读/写文件的必要部分。然后 NFS 有更多的选择来将数据分成更大的数据包——因此网络堆栈的开销更少。