vfs_lantest

File operation latency benchmark for a mounted filesystem

SYNOPSIS

vfs_lantest [-cDK] [-f tests] [-n iterations] [-q KiB] [-s MiB] -P directory

DESCRIPTION

vfs_lantest runs the test set of the Netatalk server benchmark afp_lantest(1) as POSIX file operations in directory, so that a mounted filesystem is measured end to end: the kernel, the filesystem client and the server behind it. On a FUSE mount of an AFP volume that is the Netatalk client; on a CIFS mount it is the kernel SMB client; on a local directory it is the filesystem alone. The seventeen tests, their order, their 2000-item geometry, the statistics and the CSV layout are those of afp_lantest(1), so the same chart and history scripts read both.

Every data read and write opens with O_DIRECT, so the kernel page cache never answers for the filesystem behind the mount. A plain local filesystem refuses O_DIRECT for the 1024-byte transfers of the small-file tests; pass -D there.

Server-side copies are issued with copy_file_range(2): an SMB3 or NFS 4.2 server, or a FUSE daemon implementing the operation, copies without the data crossing the mount; otherwise the kernel moves it.

Results go to standard output, progress and diagnostics to standard error. The tests run in a directory named LanTest-<pid> under directory, which is removed at the end.

OPTIONS

-P directory

Directory on the mounted filesystem to run in.

-c

CSV output: one row per test with the mean, standard deviation, minimum, maximum and median in milliseconds and the MB/s of the large-file tests, then the sum row and the aggregate block.

-D

Buffered I/O in place of O_DIRECT.

-f tests

Comma-separated test numbers, 1 to 17 (default: all). The tests that use the shared 2000 files pull in their creation and deletion.

-K

The four cache-focused tests only (14 to 17).

-n iterations

Passes over the test set, 1 to 1000 (default: 2). Above five, the fastest and slowest sample of every test are dropped.

-q KiB

Chunk size of the large-file tests (default: 1024).

-s MiB

Size of the large file (default: 100); a multiple of the chunk size.

TESTS

  1. Writing one large file, one write per chunk and the close
  2. Reading it back, one read per chunk and the close
  3. Creating 2000 files with mknod(2) and a stat of each
  4. Creating a 20x9x10 directory tree
  5. Open, write 1024 bytes, close, for each of the 2000 files
  6. Open, read 1024 bytes, close, for each
  7. Copying 1000 files through user space
  8. Copying 2000 files with copy_file_range(2)
  9. Stat of each file
  10. Listing the directory and stat of every entry
  11. Lock then unlock one byte in each of the 2000 open files
  12. Deleting the 2000 files
  13. Lock then unlock 2000 byte ranges of one file
  14. Stat of 20 directories and their 100 files each
  15. Create, stat, stat, delete on 500 files, listing every tenth round
  16. 100 walks of a 20-level directory chain, one stat per level
  17. Four stats of each of 500 files

EXIT STATUS

The vfs_lantest utility exits 0 on success, and >0 if an error occurs. A failed file operation exits with status 2 after removing what the run created; a usage error exits with status 1.

EXAMPLES

Twenty passes over a FUSE mount, as CSV:

$ vfs_lantest -c -n 20 -P /mnt/afpfs > lantest.csv

A quick run on a local directory with a 4 MiB large file:

$ vfs_lantest -D -n 2 -s 4 -P /tmp/scratch

SEE ALSO

afp_lantest(1), mount_afpfs(1), vfs_speedtest(1)