Problem:
MacOS clients experience significant performance degradation when accessing Samba shares via the macOS Finder. This is particularly noticeable when dealing with deeply nested directories and large numbers of files.
Root Cause:
This issue is caused by a known incompatibility between Samba’s default behavior and the macOS Finder’s SMB implementation. Specifically, Finder sends certain SMB requests that lead to inefficient directory listing behavior on Samba servers.
Bug Reference:
Bug 57735
Observed Behavior
- Opening directories with many files is significantly slower in macOS Finder compared to Windows Explorer.
- Performance worsens as the number of files increases.
- Affects all Samba shares accessed via macOS clients.
Solution:
- Create a Samba share optimized for macOS directly via UDM:
udm shares/share create \
--position "cn=shares,$(ucr get ldap/base)" \
--set name=macshare1 \
--set path=/macshare1 \
--set host="$(hostname -f)" \
--set sambaVFSObjects=fruit \
--set sambaCustomSettings="readdir_attr:aapl_max_access no"
- Restarting the Samba/AD DC:
/etc/init.d/samba restart
Benefits:
- Applies optimal settings for macOS compatibility.
- Ensures configuration consistency via UCS LDAP.
- Automatically triggers appropriate Samba service reload via listener module (
samba-shares.py
).
Official References
- Samba VFS Fruit Module Documentation
- Configure Samba to Work Better with macOS
- Apple Support Community Thread with Fix
See also: