User Tools

Site Tools


ubuntu:samba:resolve_rlimit_max_below_minimum_windows_limit

Ubuntu - Samba - Resolve rlimit_max below minimum Windows limit

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.

  • On MS Windows the number of file handlers on the client and the server must be identical, else you will see the “too many files open” message when e. g. copying files over the network.
  • More recent Samba versions take care of this on their own.
  • However, if you want to remove this warning, you can do so by changing your local file limits.
  • It is always useful to distinguish local (user or session) limits and global (system wide) limits.

Check you global limits

cat /proc/sys/fs/file-max

result:

3271317

NOTE: Chances are good that your global limits far exceed your local limits.

  • The typical GNU/Linux limit is in the 100k range.
  • You can change this value temporarily by executing:
sysctl -w fs.file-max=n

or permanently by editing /etc/sysctl.conf and running sysctl -p.


Check local limits

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

To check the soft limits

ulimit -Sn

result:

1024

NOTE: This will show you hard and soft limits for the local session.

  • The hard limit is enforced by the system, while the soft limit is enforced by the local session.
  • You can increase the local soft limit up to the global hard limit, if necessary.

Temporarily change limits

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.

/etc/security/limits.conf
samba soft nofile 16384
samba hard nofile 32768

NOTE: The man-pages of both files and the commands offer much more insight.

ubuntu/samba/resolve_rlimit_max_below_minimum_windows_limit.txt · Last modified: 2023/06/09 17:58 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki