Linux下新系统调用sync_file_range
Linux下系统调用sync_file_range在2.6.17后加入内存,在RHEL 5U4后面的版本都是可用的。
这篇文章有他的介绍: http://lwn.net/Articles/178199/
也可以man sync_file_range下他的具体作用, 但是请注意,sync_file_range是不可移植的,并且只在内核2.6.17及更高版本。
sync_file_range - sync a file segment with disk
sync_file_range() permits fine control when synchronising the open file referred to by the file descriptor fd with disk.
offset is the starting byte of the file range to be synchronised. nbytes specifies the length of the range to be synchronised, in bytes; if nbytes is zero, then all bytes from offset through to the end of file are synchronised. Synchronisation is in units of the system page size: offset is rounded down to a page boundary; (offset+nbytes-1) is rounded up to a page boundary.
sync_file_range可以让我们在做多个更新后,一次性的刷数据,这样大大提高IO的性能。
著名的fio工具支持sync_file_range来做sync操作,我们在决定在我们的应用中使用该syscall之前不妨先fio测试一把。
祝大家玩的开心。
扫一扫订阅我的微信号:IT技术博客大学习
- 作者:Yu Feng 来源: Erlang非业余研究
- 标签: sync_file_range
- 发布时间:2011-03-07 22:40:04
-
[899] WordPress插件开发 -- 在插件使用 -
[135] 解决 nginx 反向代理网页首尾出现神秘字 -
[56] 整理了一份招PHP高级工程师的面试题 -
[55] Innodb分表太多或者表分区太多,会导致内 -
[53] 如何保证一个程序在单台服务器上只有唯一实例( -
[52] 全站换域名时利用nginx和javascri -
[52] CloudSMS:免费匿名的云短信 -
[52] 海量小文件存储 -
[52] 用 Jquery 模拟 select -
[51] 分享一个JQUERY颜色选择插件