Welcome, Guest. Please Login or Register
The Dedicated Server Forum
  Welcome to the Dedicated Server forum.
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Why does it take ages to connect to my FTP server? (Read 5485 times)
MrWizard
YaBB Newbies
*
Offline



Posts: 2
England
Gender: male
Why does it take ages to connect to my FTP server?
May 15th, 2008 at 11:29am
 
I have a linux server with Ensim Pro 10.3.0-fc.6.11 i386 /  ProFTPD Version 1.3.0a and there is a long delay when connecting. It seems to hang and mill around for up to 10 seconds at this point...
Code:
[11:12:05] Resolving host name "ftp.hardlinkhosting.com"
[11:12:05] Connecting to 212.78.79.26 Port: 21
[11:12:05] Connected to ftp.hardlinkhosting.com.


This is especially annoying when using SmartFTP client 3.0 as it forces you to use the transfer queue and opens a new connection for the transferring (Could be a 20 seconds delay in uploading a 1KB html file)!

Below is my /etc/proftpd.conf file...
Code:
[root@ns1 ~]# cat /etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "ProFTPD"
ServerType                      Standalone
DefaultServer                   on
SocketBindTight                 on
# Define this if you want to prevent your server from displaying what FTP
# server and version you are using.
ServerIdent                     on "Hardlink Hosting FTP Server ready."

#Time out parameters
TimeoutIdle                     600
TimeoutNoTransfer               600
TimeoutLogin                    300

# Port 21 is the standard FTP port.
Port                            21

# 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 that the server normally runs at.
User                            root
Group                           root

# To disable use of system-wide password file
PersistentPasswd off

<Global>
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# This is the PAM configuration file that will be referenced when
# authenticating.  It can be set globally and/or per VirtualHost.
# The default is 'ftp'. Note: all PAM configuration files must be in
# /etc/pam.d
AuthPAMConfig                   proftpd
AuthOrder                       mod_auth_pam.c* mod_auth_unix.c

# Don't let people pass % characters to the server and to protect against DoS attacks (Bugzilla ID 1066)
DenyFilter                      (\*.*/)|%

<Limit SITE_CHMOD>
AllowAll
</Limit>

RequireValidShell               on
</Global>

# Normally, we want files to be overwriteable.
<Directory /*>
 AllowOverwrite                on
</Directory>

<VirtualHost 127.0.0.1>
</VirtualHost>

include "/etc/proftpd/proftpd.conf.wp"
# include "/etc/proftpd/anonymousftp"

Back to top
 

Give a man a fish and he eats for a day,&&Teach a man to fish and he eats for a lifetime
 
IP Logged
 
non-sequitur
Administrator
*****
Offline


Hello

Posts: 4
London
Gender: male
Re: Why does it take ages to connect to my FTP ser
Reply #1 - May 15th, 2008 at 2:13pm
 

Hi,

This is most likely because IdentLookups (http://www.proftpd.org/docs/directives/linked/config_ref_IdentLookups.html) is set to on, set it to off and it should resolve it. Reverse DNS lookups can slow connection time down as well, you can also turn it off using the UseReverseDNS directive (http://www.proftpd.org/docs/directives/linked/config_ref_UseReverseDNS.html).


Regards,

non-sequitur.
Back to top
 
 
IP Logged
 
MrWizard
YaBB Newbies
*
Offline



Posts: 2
England
Gender: male
Re: Why does it take ages to connect to my FTP ser
Reply #2 - May 16th, 2008 at 8:32am
 
Wow thanks! That's sorted it out. It now connects pretty much instantly.

I added the below two lines to the /etc/proftpd.conf file...
Code:
UseReverseDNS off
IdentLookups off

and then restarted proftpd...
Code:
service proftpd restart 


and that's it.

It seems that the above options are On by default even though not listed in proftpd.conf. I tried the two options separately and the one that slows it down most was the IdentLookups. The UseReverseDNS didn't make much different but I'll leave it off anyway.

Thanks Again!
Back to top
 

Give a man a fish and he eats for a day,&&Teach a man to fish and he eats for a lifetime
 
IP Logged
 
SXR
YaBB Newbies
*
Offline


Hello

Posts: 5
Netherlands
Gender: male
Re: Why does it take ages to connect to my FTP ser
Reply #3 - May 19th, 2008 at 5:14pm
 
Very usefull thread. Thanks.
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print