A too many open files problems
kevinhuang at qnap.com
Tue Oct 22 03:27:05 MDT 2013
After the client finish to write the file to the server, it send
"Close Request" on each file. My clinet is Win7.
And it is interesting when the client exit "aaaa" this folder, then
the samba will release all file handles in the folder.
If I want to trace this issue, which function is the start?
2013/10/22 Volker Lendecke <Volker.Lendecke at sernet.de>
> On Tue, Oct 22, 2013 at 02:39:44PM +0800, Kevin Huang wrote:
> > Hi,
> > I try to copy 50000 files to a floder that I create on my Freebsd
> > samba 4.0.8 system.
> > That would fail with the the message "Too many open files, unable
> > open more! smbd's max open files = 16384".
> > Too many open files, unable to open more! smbd's max open files =
> > [2013/10/22 14:14:58.578522, 0] ../source3/smbd/open.c:340(fd_open)
> > So I do a test I create a floder. And I just enter this folder.
> > There are there files on this folder.
> > Then I command "losf -p pid". I see the three files were still
> > holded by the process, although I don't open them.
> > smbd 66082 root 46r VREG 0,89 3894 3797927
> > /usr/home/gino1/share/aaa/aaaa/conn_idle.c
> > smbd 66082 root 47r VREG 0,89 35349 3797928
> > /usr/home/gino1/share/aaa/aaaa/close.c
> > smbd 66082 root 49r VREG 0,89 8442 3797929
> > /usr/home/gino1/share/aaa/aaaa/conn.c
> > So if I try to copy 50000 files to a new folder again, I see the
> > files that were holded by the process grow up.
> > Why the samba should keep these file handle?
> Samba should not keep files open longer than the client
> requests it to. So either your client program keeps the
> files open much longer than needed or we have a bug in
> Samba. We need a network trace of the operation first to see
> if the client closes the files. If it does, we need to look
> at strace/ktrace/debug logs why Samba would not close the
> With best regards,
> Volker Lendecke
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de
More information about the samba-technical