0

Versions:

  • ubuntu 16.04 amd64
  • nginx 1.14
  • vsftpd 3.0.3

I create 1GB file by dd. File located at home ftp user directory.

I create symlink to file: [ftp dir] -> [/var/www/nginx/html] (ln -s $SRC/1GB.test $DEST/1GB.test)

So, I can download file by:

Now I downloading file from my home router (bandwidth 50mbit/s):

wget ftp://yshinkarev.ru/1GB.test -O /dev/null
(5.50 MB/s) - '/dev/null' saved [1073741824]

wget https://yshinkarev.ru/1GB.test -O /dev/null
(2.22 MB/s) - '/dev/null' saved [1073741824/1073741824]

Why so diffs?

My vsftpd.conf:

listen=NO
listen_ipv6=YES
local_enable=YES
local_root=/home
write_enable=YES
local_umask=0000
chroot_local_user=YES
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_root=/shares/ftp
anon_umask=0000
file_open_mode=0666
dirmessage_enable=YES
use_localtime=YES
connect_from_port_20=YES
xferlog_enable=YES
ftpd_banner=FTP Server
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
hide_ids=YES
no_anon_password=YES
delay_failed_login=5
max_clients=5
max_per_ip=3
hide_file=.ssh

My nginx.conf:

user  nginx;
worker_processes  2;
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    charset utf-8;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    include /etc/nginx/conf.d/*.conf;
    server_tokens off;
}

My conf.d/default.conf (reduced):

server {
    listen 80 default_server;
    server_name yshinkarev.ru;
    return 301 https://$server_name$request_uri;
server {
    listen 443 ssl default_server;
    server_name yshinkarev.ru;
    ssl_certificate /etc/letsencrypt/live/yshinkarev.ru/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yshinkarev.ru/privkey.pem;
    location /.well-known/acme-challenge {
        root /var/www/letsencrypt;
    }
    location /images {
        root   /var/www/nginx;
    }
    error_page  404 =200             /index.html;
}
3
  • I've corrected your question so it matches the actual test. The encryption overhead may well explain the difference, so ignoring it in the title wasn't helpful.
    – MadHatter
    May 11, 2018 at 8:29
  • 1
    It's because FTP and https are different. FTP was made for transferring files. https is more general purpose and has the encryption overhead. It would be slightly interesting to see the CPU load on each end for each protocol.
    – Tim
    May 11, 2018 at 9:29
  • 1
    @tim, ftp 0.0%, https - 0.3-07.% May 11, 2018 at 10:23

0

You must log in to answer this question.

Browse other questions tagged .