help in tuning vsftpd
although i am not expert in these things, my i/o is peaking dramatically when a client is uploading very large files (>2gb) via the vsftpd server.
normally i/o averages around 0.1k - 0.2k blocks per second with occasional peaks that might reach about 0.5 - 0.6 for a very brief time, however when the upload or download starts it goes up to 1.5k or above and stays there for the duration of the process. there is no extra swap i/o associated with this. the system seldom uses swap
whilst my cpu usage goes up it only goes up to about 15% which is still very low (normally only about 4-8%). my website system seems to continue to work ok when this is happening although i am not sure how it would function if it was happening in peak use times (the system serves between 5 - 10k pageviews per day, so not particularly busy)
i have spent a number of hours researching this, but i still really have no idea if this is a cause for concern or not and/or what could be done to reduce the i/o. i have tried a couple of changes to the config (like disabling write to log), but nothing seems to make any difference.
see below my vsftpd config
# enable background mode
background=YES
# disables anonymous FTP
anonymous_enable=NO
# enables non-anonymous FTP
local_enable=YES
# activates virtual users
guest_enable=YES
ftpd_banner=Welcome to Smartspace Secure FTP
# virtual users to use local privs, not anon privs
virtual_use_local_privs=YES
# enables uploads and new directories
write_enable=YES
# the PAM file used by authentication of virtual uses
pam_service_name=vsftpd-virtual
# in conjunction with 'local_root',
# specifies a home directory for each virtual user
user_sub_token=$USER
local_root=/var/www/static/$USER
anon_root=/var/www/ftp
# the virtual user is restricted to the virtual FTP area
chroot_local_user=YES
# hides the FTP server user IDs and just display "ftp" in directory listings
hide_ids=YES
# runs vsftpd in standalone mode
listen=YES
# listens on this port for incoming FTP connections
listen_port=21
pasv_enable=YES
# the minimum port to allocate for PASV style data connections
pasv_min_port=11500
# the maximum port to allocate for PASV style data connections
pasv_max_port=11550
pasv_promiscuous=YES
# controls whether PORT style data connections use port 20 (ftp-data)
connect_from_port_20=YES
# the umask for file creation
local_umask=022
# secured empty directory
secure_chroot_dir=/usr/share/empty
ssl_enable=YES
rsa_cert_file=/var/www/ssl/vsftpd_2012.pem
force_local_data_ssl=YES
require_ssl_reuse=YES
ssl_ciphers=HIGH
log_ftp_protocol=YES
xferlog_enable=YES
xferlog_std_format=NO
vsftpd_log_file=/var/log/vsftpd.log
xferlog_file=/var/log/xferlog
dual_log_enable=YES
syslog_enable=NO
max_clients=200
max_per_ip=4
# Security
anon_world_readable_only=YES
# Features
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
# Performance
idle_session_timeout=120
data_connection_timeout=300
accept_timeout=60
connect_timeout=60
apart from this issue, everything seems to be working very well including good processing speeds. i would very much appreciate if someone could shed some light on this issue.
i am concerned that as the system gets busier it may affect performance markedly.
cheers
rs
2 Replies
if it is normal, that's ok
cheers