Hello,
I've a problem on my system with inotify.
In the smbd logfile are shown a lot messages like this:
[2015/06/10 11:15:21.644453, 0, pid=57030, effective(12700, 100),
real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init
inotify - Too many open files
[2015/06/10 11:15:23.968497, 0, pid=57030, effective(12700, 100),
real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init
inotify - Too many open files
[2015/06/10 11:15:24.192444, 0, pid=57030, effective(12700, 100),
real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init
inotify - Too many open files
[2015/06/10 11:15:28.616495, 0, pid=57030, effective(12700, 100),
real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init
inotify - Too many open files
I can't find the reason, why smbd ist complaining. But in the source code, I
see
in->fd = inotify_init();
if (in->fd == -1) {
DEBUG(0,("Failed to init inotify - %s\n", strerror(errno)));
talloc_free(in);
return map_nt_error_from_unix(errno);
}
it is nothing special from smbs/samba. But why the kernel throws this message?
Here a little bit about samba and the system:
============================================
* The samba version is 3.6.25
* Used by about 1000 users
* Linux kernel 3.0.101-0.46 64bit (SLES11SP3)
* Inotify configuration from system:
----------------------------------
# sysctl -a | grep inotify
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 65536
* The samba config:
-------------------
[global]
workgroup = Samba
map to guest = Bad User
security = user
server string = FILESERVER
load printers = no
printcap name = /dev/null
disable spoolss = yes
ldap admin dn = uid=samba_admin,o=company,c=net
passdb backend = ldapsam:"ldap://ldap01.company.net
ldap://ldap01.company.net"
ldap suffix = cn=samba,o=company,c=net
ldap user suffix = cn=accounts
ldap group suffix = cn=groups
ldap passwd sync = No
unix extensions = no
follow symlinks = yes
wide links = yes
vfs objects = extd_audit
debug uid = yes
debug pid = yes
debug class = yes
log level = 0 vfs:2
syslog = 0
max log size = 1024
log file = /var/log/smbduserlogs/%U.log
[DATA]
path = /data
comment = share
writeable = yes
browseable = no
nt acl support = no
inherit permissions = yes
store dos attributes = yes
* To check the system status regarding samba and inotify I let run
by cron following script at every 5 minutes
------------------------------------------------------------------
#!/bin/sh
LOG_FILE="/tmp/inotify.log"
d=$(date +"%c")
echo -e "\n $d ===================" >>$LOG_FILE
find /proc/*/fd/* -type l -lname 'anon_inode:inotify' 2>/dev/null |
cut -f 1-3 -d'/' | uniq -c | sort -n >>$LOG_FILE
ps -eLf >>$LOG_FILE
smbstatus >>$LOG_FILE
I never got processes with more then 10 inotify file descriptors ..
If I look to the limits from a "complaining processes" I see nothing
"wrong":
# cat /proc/57030/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 16777216 unlimited bytes
Max resident set 57507328000 unlimited bytes
Max processes 516081 516081 processes
Max open files 16404 16404 files
Max locked memory 65536 262144 bytes
Max address space 57559531520 unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 516081 516081 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Tracing the syscall inotify_init() via ftrace is not possible, because
the kernel
was not compiled with CONFIG_FUNCTION_TRACER.
Can anyone help me?
Thanks Meike
L.P.H. van Belle
2015-Jun-10 14:08 UTC
[Samba] Failed to init inotify - Too many open files
you can try : sysctl fs.inotify.max_user_instances=1536 if that does not work, try upgrading your kernel. Greetz, Louis>-----Oorspronkelijk bericht----- >Van: meike.stone at googlemail.com >[mailto:samba-bounces at lists.samba.org] Namens Meike Stone >Verzonden: woensdag 10 juni 2015 15:47 >Aan: samba at lists.samba.org >Onderwerp: [Samba] Failed to init inotify - Too many open files > >Hello, > >I've a problem on my system with inotify. > >In the smbd logfile are shown a lot messages like this: > >[2015/06/10 11:15:21.644453, 0, pid=57030, effective(12700, 100), >real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init >inotify - Too many open files >[2015/06/10 11:15:23.968497, 0, pid=57030, effective(12700, 100), >real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init >inotify - Too many open files >[2015/06/10 11:15:24.192444, 0, pid=57030, effective(12700, 100), >real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init >inotify - Too many open files >[2015/06/10 11:15:28.616495, 0, pid=57030, effective(12700, 100), >real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init >inotify - Too many open files > >I can't find the reason, why smbd ist complaining. But in the >source code, I see > > in->fd = inotify_init(); > if (in->fd == -1) { > DEBUG(0,("Failed to init inotify - %s\n", strerror(errno))); > talloc_free(in); > return map_nt_error_from_unix(errno); > } > >it is nothing special from smbs/samba. But why the kernel >throws this message? > >Here a little bit about samba and the system: >============================================> >* The samba version is 3.6.25 >* Used by about 1000 users >* Linux kernel 3.0.101-0.46 64bit (SLES11SP3) > >* Inotify configuration from system: > ---------------------------------- ># sysctl -a | grep inotify >fs.inotify.max_queued_events = 16384 >fs.inotify.max_user_instances = 128 >fs.inotify.max_user_watches = 65536 > > >* The samba config: >------------------- > >[global] > workgroup = Samba > map to guest = Bad User > security = user > server string = FILESERVER > > load printers = no > printcap name = /dev/null > disable spoolss = yes > > ldap admin dn = uid=samba_admin,o=company,c=net > passdb backend = ldapsam:"ldap://ldap01.company.net >ldap://ldap01.company.net" > ldap suffix = cn=samba,o=company,c=net > ldap user suffix = cn=accounts > ldap group suffix = cn=groups > ldap passwd sync = No > > unix extensions = no > follow symlinks = yes > wide links = yes > > vfs objects = extd_audit > debug uid = yes > debug pid = yes > debug class = yes > log level = 0 vfs:2 > syslog = 0 > max log size = 1024 > log file = /var/log/smbduserlogs/%U.log > >[DATA] > path = /data > comment = share > writeable = yes > browseable = no > nt acl support = no > inherit permissions = yes > store dos attributes = yes > > > >* To check the system status regarding samba and inotify I let run > by cron following script at every 5 minutes >------------------------------------------------------------------ >#!/bin/sh >LOG_FILE="/tmp/inotify.log" >d=$(date +"%c") >echo -e "\n $d ===================" >>$LOG_FILE >find /proc/*/fd/* -type l -lname 'anon_inode:inotify' 2>/dev/null | >cut -f 1-3 -d'/' | uniq -c | sort -n >>$LOG_FILE >ps -eLf >>$LOG_FILE >smbstatus >>$LOG_FILE > >I never got processes with more then 10 inotify file descriptors .. > > >If I look to the limits from a "complaining processes" I see >nothing "wrong": ># cat /proc/57030/limits >Limit Soft Limit Hard Limit > Units >Max cpu time unlimited unlimited > seconds >Max file size unlimited unlimited > bytes >Max data size unlimited unlimited > bytes >Max stack size 8388608 unlimited > bytes >Max core file size 16777216 unlimited > bytes >Max resident set 57507328000 unlimited > bytes >Max processes 516081 516081 > processes >Max open files 16404 16404 > files >Max locked memory 65536 262144 > bytes >Max address space 57559531520 unlimited > bytes >Max file locks unlimited unlimited > locks >Max pending signals 516081 516081 > signals >Max msgqueue size 819200 819200 > bytes >Max nice priority 0 0 >Max realtime priority 0 0 >Max realtime timeout unlimited unlimited us > > >Tracing the syscall inotify_init() via ftrace is not possible, because >the kernel >was not compiled with CONFIG_FUNCTION_TRACER. > > >Can anyone help me? > > >Thanks Meike >-- >To unsubscribe from this list go to the following URL and read the >instructions: https://lists.samba.org/mailman/options/samba > >
Hallo, Meike, Du meintest am 10.06.15:> I've a problem on my system with inotify.> In the smbd logfile are shown a lot messages like this:> [2015/06/10 11:15:21.644453, 0, pid=57030, effective(12700, 100), > real(0, 0)] smbd/notify_inotify.c:297(inotify_setup) Failed to init > inotify - Too many open files[...]> I can't find the reason, why smbd ist complaining.[...]> # sysctl -a | grep inotify > fs.inotify.max_queued_events = 16384 > fs.inotify.max_user_instances = 128 > fs.inotify.max_user_watches = 65536Maybe it helps to increase "max_user_instances" in this file; I had the same error messages and have set this parameter to 32768. sysctl -p re-reads this configuration file. Viele Gruesse! Helmut
Hello
thanks for answering!
I tried to increase the fs.inotify.max_user_instances and now I must
wait if it helps.
But I can't understand, why this should made the differences.
* Form manual page:
"max_user_instances
This specifies an upper limit on the number of inotify
instances that can be created per real user ID"
I thought, for each instance a new file descriptor is created. and the
maximum I've seen was 10 ...
Or I'm wrong?
Thanks a lot,
Meike