AFP_LANTEST(1)

πŸŽ€ AFP_LANTEST(1) πŸ’– Netatalk AFP Fileserver Manual πŸ’–

okay bestie, this is the afp_lantest page from the Netatalk AFP Fileserver Manual 🧚 part 1 of 2, so let's get into it ✨

✨ NAME ✨

afp_lantest, an AFP LAN performance and directory cache testing tool πŸ’…

πŸ“œ SYNOPSIS πŸ“œ

afp_lantest [-34567bcGgKVv] [-h host] [-p port] [-s volume] [-u user]
[-w password] [-n iterations] [-f tests] [-F bigfile]

πŸ’– DESCRIPTION πŸ’–

okay so afp_lantest is a super thorough AFP (Apple Filing Protocol) performance tester πŸ¦‹ built to put all kinds of AFP servers through their paces, and that includes how well the directory cache in netatalk is doing.

it runs a whole series of tests that measure file operations, directory traversal, and caching efficiency. it's giving classic file system benchmarks and specialized cache-focused tests that show off the perks of optimized directory cache validation and probabilistic validation features 🌈

🌸 OPTIONS 🌸

here's everything you can throw at it πŸ‘‘

  • -3 β€” use the AFP 3.0 protocol version πŸ“
  • -4 β€” use the AFP 3.1 protocol version πŸ“
  • -5 β€” use the AFP 3.2 protocol version πŸ“
  • -6 β€” use the AFP 3.3 protocol version πŸ“
  • -7 β€” use the AFP 3.4 protocol version, this is the default ✨
  • -b β€” debug mode πŸ›
  • -c β€” spit results out in CSV format (the default is tabular) πŸ“Š
  • -F bigfile β€” use an existing file in the volume root for the read test. the file size has to match what -g/-G are set to πŸŽ€
  • -f tests β€” pick which tests to run by typing digits, like "134" for tests 1, 3, and 4 πŸ’…
  • -G β€” optimize for 10-gigabit networks, which bumps the file test size up to 10 GB πŸ”₯
  • -g β€” optimize for gigabit networks, which bumps the file test size up to 1 GB πŸ”₯
  • -h host β€” server hostname or IP address (default: localhost) 🏠
  • -K β€” run only the cache-focused tests (tests 9-12) πŸ§šπŸ’œ
  • -n iterations β€” how many times to run the tests (default: 2). heads up, for iterations > 5 the outliers get removed πŸ™ˆ
  • -p port β€” server port number (default: 548) πŸ”Œ
  • -s volume β€” the volume name to mount for testing πŸ“
  • -u user β€” username for logging in to the AFP server (default: current uid) 🫢
  • -V β€” very verbose output, the chattiest setting πŸ“’
  • -v β€” verbose output πŸ”Š
  • -w password β€” password for logging in to the AFP server πŸ”‘

πŸŽ€ Example with IO Monitoring πŸŽ€

okay bestie, IO monitoring is Linux only 🐧 and it needs the proc filesystem mounted at /proc_io with hidepid=0 🧚. You also have to set gid to the group ID of whoever is running afp_lantest. no skipping that part, periodt πŸ’…

To run as root, do this first πŸ‘‘:

mkdir -p /proc_io && mount -t proc -o hidepid=0,gid=0 proc /proc_io

Then run it like this (-n 2 means two iterations, -7 is in the mix too ✨):

afp_lantest -n 2 -7 -h 127.0.0.1 -p 548 -u test -w test -s 'File Sharing'

And this is the tea β˜• it spits back:

Connecting to host 127.0.0.1:548
IO monitoring: /proc_io is available
Found cnid_dbd process for user 'test': PID 40
Found privilege-dropped afpd process for user 'test': PID 36
IO monitoring enabled (afpd: 36, cnid_dbd: 40)

Run 1 => Open, stat and read 512 bytes from 1000 files [8,000 AFP ops]        4230 ms
    IO Operations; afpd: 6000 READs, 7002 WRITEs | cnid_dbd: 0 READs, 2 WRITEs
Run 1 => Writing one large file [103 AFP ops]                                  166 ms for 100 MB (avg. 631 MB/s)
    IO Operations; afpd: 0 READs, 299 WRITEs | cnid_dbd: 0 READs, 0 WRITEs
Run 1 => Reading one large file [102 AFP ops]                                   55 ms for 100 MB (avg. 1906 MB/s)
    IO Operations; afpd: 100 READs, 100 WRITEs | cnid_dbd: 0 READs, 0 WRITEs
Run 1 => Locking/Unlocking 10000 times each [20,000 AFP ops]                   859 ms
    IO Operations; afpd: 0 READs, 20000 WRITEs | cnid_dbd: 0 READs, 0 WRITEs
Run 1 => Creating dir with 2000 files [4,000 AFP ops]                         4927 ms
    IO Operations; afpd: 2000 READs, 10006 WRITEs | cnid_dbd: 4 READs, 6151 WRITEs
Run 1 => Enumerate dir with 2000 files [~51 AFP ops]                          1740 ms
    IO Operations; afpd: 1959 READs, 50 WRITEs | cnid_dbd: 0 READs, 2 WRITEs
Run 1 => Deleting dir with 2000 files [2,000 AFP ops]                         3362 ms
    IO Operations; afpd: 4000 READs, 4004 WRITEs | cnid_dbd: 4 READs, 6177 WRITEs
Run 1 => Create directory tree with 1000 dirs [1,110 AFP ops]                 2081 ms
    IO Operations; afpd: 0 READs, 4445 WRITEs | cnid_dbd: 2 READs, 2279 WRITEs
Run 1 => Directory cache hits (100 dirs + 1000 files) [11,000 AFP ops]        5552 ms
    IO Operations; afpd: 10000 READs, 11100 WRITEs | cnid_dbd: 0 READs, 100 WRITEs
Run 1 => Mixed cache operations (create/stat/enum/delete) [820 AFP ops]       1215 ms
    IO Operations; afpd: 820 READs, 1623 WRITEs | cnid_dbd: 0 READs, 1203 WRITEs
Run 1 => Deep path traversal (nested directory navigation) [3,500 AFP ops]    1835 ms
    IO Operations; afpd: 2500 READs, 3550 WRITEs | cnid_dbd: 0 READs, 50 WRITEs
Run 1 => Cache validation efficiency (metadata changes) [30,000 AFP ops]     14559 ms
    IO Operations; afpd: 30000 READs, 30100 WRITEs | cnid_dbd: 0 READs, 100 WRITEs
Run 2 => Open, stat and read 512 bytes from 1000 files [8,000 AFP ops]        3801 ms
    IO Operations; afpd: 6000 READs, 7005 WRITEs | cnid_dbd: 0 READs, 5 WRITEs
Run 2 => Writing one large file [103 AFP ops]                                  115 ms for 100 MB (avg. 911 MB/s)
    IO Operations; afpd: 0 READs, 299 WRITEs | cnid_dbd: 0 READs, 0 WRITEs
Run 2 => Reading one large file [102 AFP ops]                                   47 ms for 100 MB (avg. 2231 MB/s)
    IO Operations; afpd: 100 READs, 100 WRITEs | cnid_dbd: 0 READs, 0 WRITEs
Run 2 => Locking/Unlocking 10000 times each [20,000 AFP ops]                  1061 ms
    IO Operations; afpd: 0 READs, 20000 WRITEs | cnid_dbd: 0 READs, 0 WRITEs
Run 2 => Creating dir with 2000 files [4,000 AFP ops]                         4739 ms
    IO Operations; afpd: 2000 READs, 10005 WRITEs | cnid_dbd: 7 READs, 6141 WRITEs
Run 2 => Enumerate dir with 2000 files [~51 AFP ops]                          1279 ms
    IO Operations; afpd: 1959 READs, 50 WRITEs | cnid_dbd: 0 READs, 1 WRITEs
Run 2 => Deleting dir with 2000 files [2,000 AFP ops]                         3470 ms
    IO Operations; afpd: 4000 READs, 4004 WRITEs | cnid_dbd: 4 READs, 6182 WRITEs
Run 2 => Create directory tree with 1000 dirs [1,110 AFP ops]                 2030 ms
    IO Operations; afpd: 0 READs, 4445 WRITEs | cnid_dbd: 2 READs, 2272 WRITEs
Run 2 => Directory cache hits (100 dirs + 1000 files) [11,000 AFP ops]        7074 ms
    IO Operations; afpd: 10000 READs, 11100 WRITEs | cnid_dbd: 0 READs, 100 WRITEs
Run 2 => Mixed cache operations (create/stat/enum/delete) [820 AFP ops]       1227 ms
    IO Operations; afpd: 820 READs, 1622 WRITEs | cnid_dbd: 2 READs, 1243 WRITEs
Run 2 => Deep path traversal (nested directory navigation) [3,500 AFP ops]    1258 ms
    IO Operations; afpd: 2500 READs, 3550 WRITEs | cnid_dbd: 0 READs, 50 WRITEs
Run 2 => Cache validation efficiency (metadata changes) [30,000 AFP ops]     20181 ms
    IO Operations; afpd: 30000 READs, 30100 WRITEs | cnid_dbd: 0 READs, 100 WRITEs
Successfully deleted test directory 'LanTest-35'

Then the big summary table shows up, all averaged out across both iterations πŸ“Šβœ¨:

Netatalk Lantest Results (Averages and standard deviations (Β±) for all tests, across 2 iterations (default))
============================================================================================================

Test                                                                Time_ms  TimeΒ± AFPD_R AFPD_RΒ± AFPD_W AFPD_WΒ± CNID_R CNID_RΒ± CNID_W CNID_WΒ±   MB/s
------------------------------------------------------------------ -------- ------ ------ ------- ------ ------- ------ ------- ------ ------- ------
Open, stat and read 512 bytes from 1000 files [8,000 AFP ops]          4015  303.3   6000     0.0   7003     2.2      0     0.0      3     2.2      0
Writing one large file [103 AFP ops]                                    140   36.1      0     0.0    299     0.0      0     0.0      0     0.0    714
Reading one large file [102 AFP ops]                                     51    5.7    100     0.0    100     0.0      0     0.0      0     0.0   1960
Locking/Unlocking 10000 times each [20,000 AFP ops]                     960  142.8      0     0.0  20000     0.0      0     0.0      0     0.0      0
Creating dir with 2000 files [4,000 AFP ops]                           4833  132.9   2000     0.0  10005     1.0      5     2.2   6146     7.1      0
Enumerate dir with 2000 files [~51 AFP ops]                            1509  326.0   1959     0.0     50     0.0      0     0.0      1     1.0      0
Deleting dir with 2000 files [2,000 AFP ops]                           3416   76.4   4000     0.0   4004     0.0      4     0.0   6179     3.6      0
Create directory tree with 1000 dirs [1,110 AFP ops]                   2055   36.1      0     0.0   4445     0.0      2     0.0   2275     5.0      0
Directory cache hits (100 dirs + 1000 files) [11,000 AFP ops]          6313 1076.2  10000     0.0  11100     0.0      0     0.0    100     0.0      0
Mixed cache operations (create/stat/enum/delete) [820 AFP ops]         1221    8.5    820     0.0   1622     1.0      2     0.0   1223    28.3      0
Deep path traversal (nested directory navigation) [3,500 AFP ops]      1546  408.0   2500     0.0   3550     0.0      0     0.0     50     0.0      0
Cache validation efficiency (metadata changes) [30,000 AFP ops]       17370 3975.4  30000     0.0  30100     0.0      0     0.0    100     0.0      0
------------------------------------------------------------------ -------- ------ ------ ------- ------ ------- ------ ------- ------ ------- ------
Sum of all AFP OPs = 80686                                            43429         57379          92278             13          16077

Aggregates Summary:
------------------------------------------------------------------
Average Time per AFP OP: 0.538 ms
Average AFPD Reads per AFP OP: 0.711
Average AFPD Writes per AFP OP: 1.144
See afp_lantest manpage for more information: https://netatalk.io/manual/en/afp_lantest.1

Dircache Statistics (/var/log/afpd.log):
------------------------------------------------------------------
Sep 24 13:30:15.702673 afpd[36] {dircache.c:632} (info:AFPDaemon): dircache statistics: (user: test) entries: 0, lookups: 244476, hits: 227977 (93.3%), misses: 9228, added: 9552, removed: 9552, expunged: 7271, evicted: 0

πŸ¦‹ IO Monitoring Result Columns πŸ¦‹

Here's what each column means, bestie:

  • Time(ms) β€” how long the test ran, in milliseconds ⏱️
  • TimeΒ± β€” the standard deviation of that runtime πŸ“‰
  • AFPD_R β€” read IO operations from the afpd process πŸ“–
  • AFPD_RΒ± β€” the standard deviation for those afpd read IO operations πŸ“–
  • AFPD_W β€” write IO operations from the afpd process ✍️
  • AFPD_WΒ± β€” the standard deviation for those afpd write IO operations ✍️
  • CNID_* β€” IO measurements for the cnid_dbd process (optional) 🧚
🚨 Note: when you're measuring afpd read/write IO with afp_lantest, make sure your afp.conf log level is set to default:error.
  • πŸ’€ More verbose logging superficially increases *_W IO values. For dirstats at least default:info is required.

πŸ“Š IO Monitoring Aggregates Summary πŸ“Š

okay so the aggregate values are purely Intrinsic Metrics 🧠, because AFP operations are a mix of reads, writes, and connection related operations. no cap, that means the numbers only make sense inside their own context 🫢

They're useful for checking how things change relative to themselves, but they don't have any external coherence or reference point for comparing against other systems. so don't go comparing your numbers to someone else's machine, bestie πŸ™ˆ

Generally, values less than 1 mean efficient operation (for example, because of batching and caching etc), and values greater than 1 mean sub-optimal operation (for example, amplification of a single operation that causes additional downstream operations). it's giving efficiency or it's giving drama πŸ’…

πŸ”₯ Note: total AFP Ops are a mix of reads, writes, and other ops, so the effective 1:1 (AFP:IO) thresholds are not equal to 1. Accurate thresholds can be calculated on a per test basis using the information shown in the Testing Wiki, by comparing the relevant AFP read/write ops with the relevant AFPD_R/AFPD_W values.

Ideally, code changes should show the aggregate values going down πŸ“‰πŸ’–

For more information, see the Testing Wiki πŸ“š

🌸 Return Codes 🌸

  • 0 β€” all tests passed successfully πŸŽ‰
  • 1 β€” one or more tests failed πŸ’€

πŸ“ Notes πŸ“

  • πŸŽ€ Tests that involve large file operations (tests 2 and 3) will create temporary files in the test volume.
  • ⏳ The -g and -G options significantly increase test file sizes and test duration.
  • πŸ¦‹ Cache-focused tests (8-11) give the most insight into netatalk's directory cache performance.
  • πŸ” Multiple iterations (-n) are recommended for consistent performance measurements.
  • πŸ” The tool requires write access to the specified AFP volume.

✨ See Also ✨


and that's the whole vibe, bestie 🫢 this was Netatalk 4.5.1, page AFP_LANTEST(1), served with extra sparkle πŸ’–πŸ§š

πŸ“¦ where this page comes from
  • fedora 44: netatalk-afptest 5:4.5.1-1.fc44 Β· GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-BSD AND FSFUL AND LicenseRef-Callaway-MIT
  • πŸ’– girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms