# fastest filesystem?



## MHA152 (Aug 22, 2013)

Hello everybody.

I am using the UFS filesystem, but it's slow because when I was using Linux and the EXT4 filesystem the speed of copying and moving files was more than now.

How can I have a faster filesystem?


----------



## borov (Aug 22, 2013)

Use ZFS if you have plenty of RAM*.*


----------



## MHA152 (Aug 22, 2013)

I have 3 GB RAM but I don't like ZFS because I don't need many ability and I just want to have a good filesystem*.*


----------



## ShelLuser (Aug 22, 2013)

MHA152 said:
			
		

> I am using the UFS filesystem, but it's slow because when I was using Linux and the ext4 filesystem the speed of copying and moving files was more than now.


That really doesn't say anything about the file system. For example; by default Linux also heavily uses caching, which will easily give the impression that certain file system related actions are much faster, while in fact everything is simply happening in the background where you'll be unaware of this.

The solution here isn't so much moving to another file system (you'll suffer from the same issues) but instead to optimize what you're currently using.

Here is a good starting point at the FreeBSD wiki on system tuning. Although this is aimed at the entire system, you'll also find topics which specifically address file systems or topics which can enhance I/O operations.

For example: sysctl tuning, CPU or Memory & disk tuning.

Apart from this wiki you'll also find a whole chapter in the FreeBSD handbook about tuning disks, also worth reading. Because although you're blaming the file system; it's also very well possible that FreeBSD doesn't fully support your hardware for example.

There is much more to this issue, and what you've been experiencing (slower I/O ratings) is by far enough to start pointing at specifics such as the file system alone.


----------



## J65nko (Aug 22, 2013)

Linux does async mounts, that is why it is seems to be faster than UFS. If you like you can do that with FreeBSD too.   From mount(8):


```
[file]async[/file]
       All I/O to the file system should be done asynchronously.
       This is a [u]dangerous[/u] flag to set, since it does not guar-
       antee that the file system structure on the disk will
       remain consistent.  For this reason, the async flag
       should be used sparingly, and only when some data recov-
       ery mechanism is present.
```

A less dangerous option to speed up file operations from that same man page:


```
[file]noatime[/file]
        Do not update the file access time when reading from a
        file.  This option is useful on file systems where there
        are large numbers of files and performance is more criti-
        cal than updating the file access time (which is rarely
        ever important).  This option is currently only supported
        on local file systems.
```

Use soft updates. From one of my systems: 


```
[cmd=#] tunefs -p /dev/mirror/gm0s1a[/cmd]
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: [color=blue]soft updates: (-n)                                 enabled[/color]
tunefs: soft update journaling: (-j)                       disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)
```
Read tunefs(8) how to enable.

From the /etc/fstab file of that same box using the noatime option:

```
# Device                Mountpoint      FStype  Options         Dump Pass# 
/dev/mirror/gm0s1a      /               ufs     rw,[color=blue]noatime[/color]      1       1 
/dev/mirror/gm0s1b      none            swap    sw              0       0 
/dev/mirror/gm0s1d      /usr            ufs     rw,[color=blue]noatime[/color]      2       2
```


----------



## SirDice (Aug 23, 2013)

Some very good suggestions already, just wanted to throw in my 2 cents. The slowness could also be caused by unaligned partitions on a 4K sector drive. If you search the boards you will find more posts about slowness and 4K drives, including tips on how to properly align them.


----------



## belon_cfy (Aug 30, 2013)

MHA152 said:
			
		

> I have 3 GB RAM but I don't like ZFS because I don't need many ability and I just want to have a good filesystem*.*



ZFS is one of the best file system around the world. If ZFS is not as good as what you though, nothing is good. ZFS is the winner among the rest of FS such as NTFS, ext4, BTRFS, etc. ZFS not fast enough? Attaching an SSD will make the difference.


----------



## wblock@ (Aug 30, 2013)

Last I looked, UFS was faster than ZFS on the same hardware.  But it's not a fair comparison, because ZFS does a lot more than UFS.

There are people here who report using ZFS on machines with only 1 GB of RAM.  Seeing the compromises made to limit ZFS memory use and the resulting speed would be interesting.


----------

