大网数据广告活动
服务器运维问答

Resolving samba testparm message: rlimit_max: rlimit_max (8192) below minimum Windows limit (16384)

· 52CE 我爱测

testparm in samba may produce this message: rlimit_max: rlimit_max (8192) below minimum Windows limit (16384) This appears be be resolved by increasing the max open file limit using this Linux command ulimit -n 16384 .. Is this a…

问题原文

原帖链接 · jcalfee · CC BY-SA 3.0

testparm in samba may produce this message:

rlimit_max: rlimit_max (8192) below minimum Windows limit (16384) 

This appears be be resolved by increasing the max open file limit using this Linux command ulimit -n 16384..

Is this a safe change for the typically Samba box? Where should this setting be stored so that it will be available to the samba service on boot?

社区高分解答

原帖链接 · bjanssen · CC BY-SA 3.0

First off, 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 with

 cat /proc/sys/fs/file-max

Chances are good that your global limits far exceed your local limits. I think the typical GNU/Linux limit is in the 100k range, I haven't looked in a really long time. You can change this value temporarely by executing

sysctl -w fs.file-max=n

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

To check your local limits, switch to the concerned user, e. g. samba, and run

ulimit -Hn
ulimit -Sn

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.

You can change the limits temporarely 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

As always the man-pages of both files and the commands offer much more insight. Hope that helps.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-05-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。