Running the testparm command, which checks the Samba config file for errors, sometimes shows a message:
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
NOTE: This is just a warning.
cat /proc/sys/fs/file-max
result:
3271317
NOTE: Chances are good that your global limits far exceed your local limits.
sysctl -w fs.file-max=n
or permanently by editing /etc/sysctl.conf and running sysctl -p.
NOTE: Run these commands as the user which is running Samba.
Hard limits are enforced by the system:
To check the hard limits:
ulimit -Hn
result:
65536
ulimit -Sn
result:
1024
NOTE: This will show you hard and soft limits for the local session.
You can change the limits temporarily by running:
ulimit -Hn n ulimit -Sn m
or you can set user limits via /etc/security/limits.conf and you can even specify for which users which limits apply, e. g.
samba soft nofile 16384 samba hard nofile 32768
NOTE: The man-pages of both files and the commands offer much more insight.