FreeBSD performance

Due to some persistent crashes attributable to the AMD gpu driver, I switched my main machine from FreeBSD to the NixOS Linux distribution a couple of months ago, having first backed up the FreeBSD install with Clonezilla. NixOS presented some problems of its own and the availability of an updated AMD driver prompted me to switch back to FreeBSD (made simple with Clonezilla), which I generally much prefer to Linux.

When I did this, I noticed that the system felt faster. Curious (and having done a lot of performance work during part of my long career in software development) I did some tests with a report generator that is part of a set of financial management applications I wrote for myself and my family. The report generator is the most resource intensive of these applications. The (25 years of) financial data is stored in a Sqlite database. To generate the year-to-date reports on NixOS/Linux system took about 22 seconds elapsed time. Running the same (obviously recompiled) code on the FreeBSD install takes about 16.5 seconds, about 25% faster.

This is hardly a definitive evaluation of the relative performance of the two systems, but I thought it was interesting enough to do all this typing :)

While the report generation application is cpu-limited on both systems, I should mention that the Linux install used an ext4 file-system with journaling disabled (no lectures, please, on the dangers of this; I'm well aware of them and deal with them appropriately). The FreeBSD install uses UFS with soft updates enabled, no journaling.
 
How much disk IO is done during those 22 or 16 seconds? How many MB, how many IO requests? One of my suspicions would be different caching of data in the file system, or a more sequential (faster) layout in one OS.

Another question: Of the 22 or 16 seconds, how much is user space time, how much is system time? If you run the program(s) with /usr/bin/time, it will give you those.
 

cluster read-ahead max block count​

To anyone with an interest in performance.

If you:
  • use ZFS on FreeBSD
  • do not actively use any file system that is associated with vfs.read_max
– try:

sysctl vfs.read_max=0

– then use the OS and apps as you normally would. Set the zero in your sysctl.conf(5), if you like.

Holistically: better or worse (with no read-ahead)?



From discussion elsewhere: "… cluster_read is called by code in the ffs, ext2fs, udf, cd9660, msdosfs, and fuse subdirectories, …"
 
Back
Top