正确的 fcntl 标志是什么?
当从磁盘读取数据并通过网络写入文件以获得最佳速度时,正确的 fcntl 标志是什么?
也许问题出在文件描述符上设置的 fcntl 标志?
What would be the right fcntl flags when reading from a disk and writing to a file over the network for best speed?
perhaps the issues is with the fcntl flags set on the file descriptor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为
fcntl
不会为您提供任何会影响性能的内容。也许您正在寻找 posix_fadvise ,但我认为主要关键是使用相当大的缓冲区。I don't think
fcntl
offers you anything that would affect performance. Perhaps you're looking forposix_fadvise
, but I think the main key is just to use reasonably large buffers.我假设您正在使用 NFS(或类似的东西)通过网络读取/写入文件。最好的选择是读/写文件的必要部分。然后,NFS 有更多选项将数据划分为更大尺寸的数据包,从而减少网络堆栈的开销。
I am assuming that you are using NFS (or something like that) to read/write to a file across the network. The best option is to read/write as large as necesssary parts of the file. Then the NFS has more options as to dividing the data up into the larger size packets - hence less overhead in terms of the network stack.