# Slow FTP connection [SOLVED]

## link1305

Hello,

I'm running an FTP server on my server at home (gentoo/proftpd) and connecting to it is really slow. I'm at school right now (about 45 minutes away from home) and it takes about a minute to connect so I can browse the FTP.  The windows flashlight is just moving back and forth.  Any general things that might make it slow?  If I remember correctly, it's also slow connecting when I'm on my own lan...which is strange.  Any ideas?

Thanks guysLast edited by link1305 on Sat Oct 15, 2005 4:57 am; edited 1 time in total

----------

## befa

when you're at school, that depends on your broadband... but i duno why it's so long when you're at home... you browse it on local....

----------

## Crisis

Try running it from the command line and see if there is a difference.  Also, if you are on a home connection with a router, trying making sure you are using PASV mode.  IE dose not use this by default.

Check to make sure if it is faster at home or not, and again don't use IE as an ftp client.

----------

## UberLord

Turn off things like hostname lookups and other such sillyness in proftpd - or use vsftpd which is faster  :Smile: 

----------

## link1305

Thanks for the suggestions so far   :Very Happy: 

I downloaded an FTP program and it's faster than it was with windows, but it still takes +-30 seconds.  Using IE I can connect to my FTP server for my webspace (though 1and1) and it takes 5 seconds tops   :Confused:     Here's my configs for proftpd....any suggestions for things to change?

```

ServerName          "Turn It On Again - FTP"

ServerType          inetd

DefaultServer       on

RequireValidShell   off

AuthPAM             off

AuthPAMConfig       ftp

# Port 21 is the standard FTP port.

Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files

# from being group and world writable.

Umask                           022

# To prevent DoS attacks, set the maximum number of child processes

# to 30.  If you need to allow more than 30 concurrent connections

# at once, simply increase this value.  Note that this ONLY works

# in standalone mode, in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd).

MaxInstances                    30

# Set the user and group under which the server will run.

User                            proftpd

Group                           proftpd

# Normally, we want files to be overwriteable.

<Directory />

  AllowOverwrite                on

</Directory>

# A basic anonymous configuration, no upload directories.

#<Anonymous ~ftp>

#  User                         ftp

#  Group                                ftp

  # We want clients to be able to login with "anonymous" as well as "ftp"

#  UserAlias                    anonymous ftp

  # Limit the maximum number of anonymous logins

#  MaxClients                   4

  # We want 'welcome.msg' displayed at login, and '.message' displayed

  # in each newly chdired directory.

#  DisplayLogin                 welcome.msg

#  DisplayFirstChdir            .message

 # Limit WRITE everywhere in the anonymous chroot

#  <Limit WRITE>

#    DenyAll

#  </Limit>

#</Anonymous>
```

```

service ftp

{

       flags            = REUSE

       socket_type      = stream

       instances        = 30

       wait             = no

       user             = root

       server           = /usr/sbin/proftpd

       log_on_success   = HOST PID USERID

       log_on_failure   = HOST USERID ATTEMPT

       disable          = no

}

```

----------

## link1305

Heres an update...

I'm home now, and even when on a LAN with the server it still takes 30+ seconds to connect.  I tried changing the server from inetd to standalone to see if anything would change, but now I get the error "421 Service not available, remote server has closed connection" when I try to 'ftp localhost'    :Mad: 

Any suggestions?

----------

## link1305

Well, I guess I found the reason it was so slow.

After commenting out these two lines in the xinetd config for proftpd it takes only about 10 seconds now

```
      log_on_success   = HOST PID USERID 

       log_on_failure   = HOST USERID ATTEMPT
```

  Strange...

----------

## Crisis

Could also be an issue with resolving the host names if it is trying to resolv dns before completing the connection..

----------

## Mroofka

Have you tried this:

```
UseReverseDNS           off     #bedzie troche szybciej  

IdentLookups            off     #bedzie jeszcze szybciej 

```

Pozdrawiam

----------

## Crisis

You marked it solved, what was the solution?

----------

## link1305

See 2 posts above  :Wink:   My solution was:

After commenting out these two lines in the xinetd config for proftpd it takes only about 10 seconds now: 

 *Quote:*   

>    log_on_success   = HOST PID USERID 
> 
>        log_on_failure   = HOST USERID ATTEMPT 

 

----------

## wHAcKer

 *Mroofka wrote:*   

> Have you tried this:
> 
> ```
> UseReverseDNS           off     #bedzie troche szybciej  
> 
> ...

 

Thanks man, this solved the slow listing.

I sometimes got comments from other people at LANs that my ftp was slow and then I tried it (with my machines) and it worked fine & fast so I didn't bother. This was because they are in the hosts file and the other PC's aren't.

It wasn't untill my internet connection was cut off (because I'm moving to a new place) than I noticed that my new laptop had the same problem (as it's a machine from my employer I didn't enter it in the hosts file) and I came around to fix it.

----------

## oiper

 *Mroofka wrote:*   

> Have you tried this:
> 
> ```
> UseReverseDNS           off     #bedzie troche szybciej  
> 
> ...

 

Wow. I've ignored this debilitating problem for a while. Thanks Mroofka. I can finally work from my laptop again.    :Very Happy: 

----------

