1

I've initialised one large primary partition with the -T small flag to mke2fs, small on the system is configured as follows:

    small = {
            blocksize = 1024
            inode_size = 128
            inode_ratio = 4096
    }

This is a 800 GB SSD (cloud drive) which will be a home for the 10+ million small files, ranging from ~10KB to ~100KB.

I tried to go thoroughly the man pages of mount and figure out the best combo of flags and here's my list:

  • rw - read and write
  • nosuid - no need for user or group ID on execution
  • nodev - block dev files should never appear in here
  • noexec - files with exec bit set are also not welcome
  • auto - allow mount -a
  • nouser - only root can (re)mount
  • async - async writing
  • relatime - update access time only when files are modified.
  • data=ordered - presumably should improve read performance
  • errors=remount-ro - stop writing when errors
  • discard - recommended for SSD
  • auto_da_alloc - fight filesystem corruption in case of power failure (perhaps not needed, as this is a cloud drive?)
  • inode_readahead_blks=16 - file system will be a home for the great bunch of small files, hence big readahead should be nothing more but a performance penalty. I didn't know the optimal value for files of average size 50KB, so just put here twice as less value as the default.
  • debug

I really need a second opinion from someone more experienced in these matters. I'm particularly unsure about the discard, relatime, data=ordered, auto_da_alloc, inode_readahead_blks and other flags, which I have missed or misunderstood. How dangerous is data=writeback? How much data I may loose with such flag, is it just the last 5 sec (default value of commit)? Other insight regarding this exercise?

NarūnasK
  • 408

2 Answers2

1

You should probably just use the XFS filesystem for this.

ext4 is not well-suited to this workload because you're on an SSD and have a stupid-high file count. There's a reason Red Hat now defaults to XFS.

ewwhite
  • 201,205
0

Why not consider using ZFS on linux? ZFS is definetly superior to ext4 and it's considered production ready on linux. See http://www.phoronix.com/scan.php?page=news_item&px=MTc4NTM

It's not difficult to install; see http://zfsonlinux.org/ for installation info.

Peter
  • 152