在一个目录中创build和安装包含> 10M文件的ext4卷的最佳选项

什么是适当的选项mkfsmount ext4文件系统与文件夹包含> 1000万文件的读取权限?

我到目前为止:

 umount /media/dirsizetest mkfs.ext4 -L DIRSIZETEST -E lazy_itable_init=1 -E lazy_journal_init=1 -m 1 /dev/sda1 mount -t ext4 -o nodiratime /dev/sda1 /media/dirsizetest 

一些情况是为了。 我正在做一个稍微(好,非常)疯狂的实验,涉及到看到不同文件系统如何用一个文件夹充满数以百万计的小文件。 最终我会填满1TB的容量来做这件事(我告诉你这是一个疯狂的实验!)。

访问模式是这样的:

 Recreate the volume from scratch (using mkfs) and mount it. Create a sub-directory, fill it with N files in sequence (named 1...N) (where N can be up to 2^63) Read all files in order Read all files in random order Print how it takes 

我的自然栖息地是Windows NTFS世界, mountmkfs选项的数量有点令人生畏。 所以我正在寻找哪些选项可能会在我的脚下performance出我的performance。

我正在64位Ubuntu 12.04桌面环境中工作。

注意:安全build议

这些说明是不安全的,不应在没有预防措施的情况下在生产环境中使用。

例如,电池支持的RAID卡可以帮助降低风险。

使用风险自负


如果你只是喜欢它作为一个testing环境,我会推荐ext4选项

 noatime,data=writeback,barrier=0,nobh,errors=remount-ro 

这个

  • 在读取时禁用访问时间
  • 懒洋洋地写元数据
  • 禁用强制执行期刊提交的正确的磁盘顺序
  • 尽量避免关联缓冲区头部
  • 重新安装只读错误

对于mkfs.ext4我只能find选项

 dir_index Use hashed b-trees to speed up lookups in large directories. 

有用

我做了一些研究,发现了以下链接。 Chris Perrin的答案提供了一个简短的选项列表; 这些应该提供额外的参考资料。

  • 提高ext4性能的博文
  • Kernel.org文档ext4
  • man页为mkfs.ext4