Hi Andy,

Thank you so much for detailed help and attention!

I've checked some forums about changing linux open file limits but I
was apprehensible of doing that once the problem could be with FTP server.
Now I consider what you told me about putting aside any ftp error...

So lets try that! I've changed my file limit to 32768 and I will monitor the
system about that.

Thank you so much,

On Mon, Feb 7, 2011 at 1:50 PM, Andy Thomson <[email protected]> wrote:

> On Mon, 7 Feb 2011 12:12:53 -0200
> Danilo Rosetto Muñoz <[email protected]> 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,
> >
>
> Danilo,
>
> 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:
>
> bash:
>
> 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
> executed.
>
> 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.
>
>  /etc/security/limits.conf
>
> 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.
>
> ---
>
> Andy
>
>
>
>
>
>
>
>
>


-- 
Danilo Rosetto Muñoz
[email protected]
http://br.linkedin.com/in/danilomunoz

Reply via email to