I/O-stat module for Samba

Shachar Sharon ssharon at redhat.com
Wed Apr 2 04:24:50 UTC 2025


Samba over CephFS has been under heavy development recently (here, at
RH/IBM) and we reached the point where we would also like to extend
Samba's I/O monitoring capabilities: inspect the latency and
throughput of every share from within the smbd process itself (per
node). Having such run-time metrics, when exported to the storage
administrator (via Ceph dashboard), would provide a better overview of
cluster smb I/O activity.

Samba already has profile capabilities (when enabled) but those
counters represent global state instead of (dynamic) per-share state.

We would like to propose a new solution which may be useful to other
users as well: use Samba's stackable modules capabilities and provide
new VFS module ("vfs_iostat.c") which tracks I/O counters per-share
(and per-node) using in-memory cache. Those in-memory counters will be
flushed periodically into local TDB file and may be consumed and
displayed via one of Samba's utilities (e.g. smbstatus or similar).

Advantages:
1. Tracking I/O counter per-share dynamically (only for those with
iostat in their 'vfs object' stack).
2. Low overhead when writing to TDB file, even when having hundreds of
active smb shares (each process/share has its own unique TDB entry).
3. May be extended beyond monitoring (e.g.: rate limits).

A basic POC to demonstrate the above ideas can be found at:
  https://gitlab.com/samba-team/devel/samba/-/commits/synarete/vfs_iostat_poc

Comments and ideas are most welcome.

- Shachar.




More information about the samba-technical mailing list