ZFS zfs vs ufs on a 6 core amd64 with 16g ram

1 which is better for webserver
2 for db?
3 at what amount of ram or disk does one prefer over other?
4 why?
 
What is your definition of "better"?

Let me make two suggestions (both tongue in cheek) that will lead to radically different answer:
  • Better = easier to administer, don't need to learn complicated commands or new concepts.
  • Better = protects the data against undetected read errors on the disk, and provides RAID-like functionality.

If your definition of "better" is: performance (or performance/cost), then you have to be much more specific about your workload. What does the web server do? Static files? Are the files big or small? Does it serve dozens of different files or billions of them? Is there a lot of CGI, business logic, database backends? Similar questions apply to "database": Is the database doing transaction processing and OLTP (like TPC-C), or is it doing data mining? Both are popular database workloads. How big is the database (including indices), with respect to the main RAM? What is the working set?

To answer your question, we need much more detail.
 
1 which is better for webserver
2 for db?
3 at what amount of ram or disk does one prefer over other?
4 why?

1) I don't know. It probably makes very little difference.
2) I don't know. It also probably makes very little difference.
3) In my experience ZFS needs a minimum of somewhere between 2GB and 4GB of RAM on the system. However, my experience is very limited.
4) for 1 and 2, I don't know because I haven't done any extensive testing. I've run Web servers on both UFS and ZFS and have not seen much of a difference. I have run database (PostgreSQL and MySQL) on UFS without any issues. For #3 there is documentation that suggests in "low ram environments" you need to tweak some ZFS settings and the system I run ZFS on has 16GB of ram but ZFS has never used more than 4GB (and usually is using less).

Benefits of ZFS:
- Very easy software RAID setup (useful if you have multiple hard drives).
- snapshots are very handy for a variety of system administration tasks.
- other functionality that makes system administration much easier.
- you can use an SSD as a cache for large arrays of spinning disks to (theoretically) speed things up.
- you can create multiple data sets in a raid pool (roughly like making multiple FreeBSD partitions in a slice) that all share the same space among them while still being able to set upper limits on how much a single data set can consume. Think about creating and destroying a bunch of jails over time (like you might in a shared hosting setup).
- some cross-platform compatibility (Solaris, some Linux, and other OSes support ZFS too).

Benefits of UFS:
- Uses significantly less system resources (RAM and CPU) compared to ZFS.
- Backwards compatible with earlier versions of FreeBSD.

The both offer:
- software RAID (UFS and GEOM together, handbook chapter 18)
- ability to compress partitions/pools (see geom_uzip)
- ability to encrypt partitions/pools (UFS and GEOM together, handbook chapter 18)
- fault tolerance (UFS with softupdates or journaling)

If you have not used ZFS before, I suggest you try it out. In my opinion, the simplified administrative functionality alone is worth it if you have the RAM to handle it.
 
Back
Top