mina-ftpserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Thomson <a10008...@gmail.com>
Subject Re: [Too many open files] problems
Date Mon, 07 Feb 2011 15:50:55 GMT
On Mon, 7 Feb 2011 12:12:53 -0200
Danilo Rosetto Muñoz <munozdanilo@gmail.com> wrote:

> Hi all,
> After some time running FTP Server embedded on my app I get a "Too
> many open files" error.
> I have tried some diagnostics with lsof -p [my app PID] and I could
> get many connections on FTP port.
> My scenario:
> ~ 30 client
> All clients uses same login: mpv
> I tried set maxloginperip property. Here go my config file:
> > ftpserver.user.mpv.enableflag=true
> > ftpserver.user.mpv.homedirectory=/ftp/homedir
> > ftpserver.user.mpv.idletime=1200
> > ftpserver.user.mpv.maxloginnumber=0
> > ftpserver.user.mpv.maxloginperip=20
> > ftpserver.user.mpv.userpassword=######
> > ftpserver.user.mpv.writepermission=true
> I've attached FTP logging .. please, try finding:
>  -> NullPointerException
>  -> java.io.IOException: Connection reset by peer
> Thanks in advance,


Putting aside any potential issues with the ftp server, this may
actually be a low file limit in your environment. 

You many need to increase the file limit:


In Ubuntu (and I assume Debian, others), the limit is minimal, only 1024
open files are allowed.  A ftp server process will easily consume this
number of files.

bash> ulimit -a | grep open
      open files                      (-n) 1024

Set the number of open files to a more reasonable number. Note this
needs to be set in the same shell or environment where the Java is

bash> ulimit -n 32768

bash> java -jar myftpserve.jar ...

It's not likely you will need more than the default kernel limits:

cat /proc/sys/fs/nr_open
      -- or --
sysctrl -A | grep "fs.nr_open"

If you get an error setting the ulimit, check the security file.


There may be a limit setting in-place there, if so, you will need to
increase it past the number of open files you need.  If one is not
defined then, it's defaulting to the kernel limits.

Search on Google for fs.nr_open, lot's of information on this for the
various implementations of Linux.

Hopefully this is useful.



View raw message