Upload slow/stalling

Hello everyone!

I’m having problems with my seafile setup. I’m hosting seafile on my VPS using docker-compose.
While uploading files I’m very often experiencing extremly slow upload times. Sometimes i can use nearly all my upload speed from my internet connection (5mbps), but about 95% of the time I can barely use more than 10kbps. This affects browser (tested chrome and firefox), Desktop Client and SeaDrive. Using webdav I start using about 75% of my connection and then it stalls after about 20-30mb, never to resume.
What confuses me is, that I sometimes actually can use all of my internet speed. I triple checked if my server is under to much load, but that is not the case. I can upload files using other tools at full speed at the same time. My hard drives are also under barely any load. I checked every possible metric in Netdata.

My docker-compose:

version: '2.0'
services:
  db:
    image: mariadb:10.5
    restart: always
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=MY-DB-ROOT-PASSWORD
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - seafile-db:/var/lib/mysql
    networks:
      seafile-network:
        ipv4_address: 10.123.1.10
        aliases:
          - db

  memcached:
    image: memcached:1.5.6
    restart: always
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      seafile-network:
        ipv4_address: 10.123.1.11
        aliases:
          - memcached

  seafile:
    image: seafileltd/seafile-mc:latest
    restart: always
    container_name: seafile
    volumes:
      - seafile-data:/shared
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=MY-DB-ROOT-PASSWORD
      - TIME_ZONE=Europe/Berlin
      - SEAFILE_ADMIN_EMAIL=MY-EMAIL
      - SEAFILE_ADMIN_PASSWORD=MY-PASSWORD
      - SEAFILE_SERVER_LETSENCRYPT=false
      - SEAFILE_SERVER_HOSTNAME=MY--SERVER-HOSTNAME
    depends_on:
      - db
      - memcached
    networks:
      seafile-network:
        ipv4_address: 10.123.1.12
        aliases:
          - seafile


volumes:
  seafile-db:
  seafile-data:

networks:
  seafile-network:
    driver: bridge
    driver_opts:
      com.docker.network.bridge.name: br-seafile
    enable_ipv6: false
    ipam:
      driver: default
      config:
        - subnet: ${IPV4_NETWORK:-10.123.1}.0/24

My NGINX config:

server {
    listen 80;
    listen [::]:80;
    server_name MY-DOMAIN-NAME;
    return 302 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name MY-DOMAIN-NAME;

   include /etc/nginx/conf.d/tls.conf;

   client_max_body_size 0;

   add_header Content-Security-Policy "default-src 'none'; connect-src 'self'; font-src 'self' data:; img-src 'self' data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';";
   add_header X-Content-Type-Options nosniff;
   add_header X-Frame-Options "SAMEORIGIN";
   add_header X-XSS-Protection "1; mode=block";

   location / {
       proxy_pass http://10.123.1.12:80;
       proxy_read_timeout 1200s;
       proxy_set_header Host $host;
       proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header Connection "";
       proxy_http_version 1.1;
       client_max_body_size 0;
   }

   location /seafhttp {
       rewrite ^/seafhttp(.*)$ $1 break;
       proxy_pass http://10.123.1.12:80;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       client_max_body_size 0;
       proxy_connect_timeout  36000s;
       proxy_read_timeout  36000s;
      proxy_request_buffering off;
   }

   location /seafdav {
       proxy_pass         http://10.123.1.12:80;
       proxy_set_header   Host $host;
       proxy_set_header   X-Real-IP $remote_addr;
       proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header   X-Forwarded-Host $server_name;
       proxy_set_header   X-Forwarded-Proto $scheme;
       proxy_read_timeout  36000s;
       client_max_body_size 0;
   }

   location /media {
       proxy_pass http://10.123.1.12:80;
       proxy_read_timeout 120s;
       proxy_set_header Host $host;
       proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header Connection "";
       proxy_http_version 1.1;
       client_max_body_size 0;
    }
}

When you run top on the server while uploading what shows wa/%wa? (Could also be worth to look for disk utilization on the client.)

What is the latency between you and the VPS?

When you transfer data over SSH, does it constantly utilize your connection?

1 Like

What ist wa/%wa?

My output from running top (using docker-compose, so we only see relevant data):

seafile
UID PID PPID C STIME TTY TIME CMD

root 1693450 1693430 0 10:56 ? 00:00:00 /usr/bin/python3 -u /sbin/my_init – /scripts/enterpoint.sh
root 1693526 1693450 0 10:56 ? 00:00:00 /usr/bin/runsvdir -P /etc/service
root 1693527 1693450 0 10:56 ? 00:00:00 /bin/bash /scripts/enterpoint.sh
root 1693528 1693526 0 10:56 ? 00:00:00 runsv cron
root 1693529 1693526 0 10:56 ? 00:00:00 runsv sshd
root 1693530 1693526 0 10:56 ? 00:00:00 runsv nginx
root 1693534 1693530 0 10:56 ? 00:00:00 nginx: master process /usr/sbin/nginx
root 1693535 1693528 0 10:56 ? 00:00:00 /usr/sbin/cron -f
root 1693541 1693527 0 10:56 ? 00:00:11 python3 /scripts/start.py
33 1693556 1693534 0 10:56 ? 00:00:03 nginx: worker process
33 1693557 1693534 0 10:56 ? 00:00:00 nginx: worker process
33 1693558 1693534 0 10:56 ? 00:00:00 nginx: worker process
33 1693559 1693534 0 10:56 ? 00:00:00 nginx: worker process
33 1693560 1693534 0 10:56 ? 00:00:00 nginx: worker process
33 1693561 1693534 0 10:56 ? 00:00:00 nginx: worker process
33 1693562 1693534 0 10:56 ? 00:00:00 nginx: worker process
33 1693563 1693534 0 10:56 ? 00:00:00 nginx: worker process
root 1693875 1693450 0 10:56 ? 00:00:04 python3 /opt/seafile/seafile-
server-8.0.7/seahub/thirdpart/bin/gunicorn
seahub.wsgi:application -c /opt/seafile/conf/gunicorn.conf.py
–preload
root 1693917 1693875 0 10:56 ? 00:00:08 python3 /opt/seafile/seafile-
server-8.0.7/seahub/thirdpart/bin/gunicorn
seahub.wsgi:application -c /opt/seafile/conf/gunicorn.conf.py
–preload
root 1693918 1693875 0 10:56 ? 00:00:11 python3 /opt/seafile/seafile-
server-8.0.7/seahub/thirdpart/bin/gunicorn
seahub.wsgi:application -c /opt/seafile/conf/gunicorn.conf.py
–preload
root 1693919 1693875 0 10:56 ? 00:00:09 python3 /opt/seafile/seafile-
server-8.0.7/seahub/thirdpart/bin/gunicorn
seahub.wsgi:application -c /opt/seafile/conf/gunicorn.conf.py
–preload
root 1693920 1693875 0 10:56 ? 00:00:07 python3 /opt/seafile/seafile-
server-8.0.7/seahub/thirdpart/bin/gunicorn
seahub.wsgi:application -c /opt/seafile/conf/gunicorn.conf.py
–preload
root 1693921 1693875 0 10:56 ? 00:00:08 python3 /opt/seafile/seafile-
server-8.0.7/seahub/thirdpart/bin/gunicorn
seahub.wsgi:application -c /opt/seafile/conf/gunicorn.conf.py
–preload
root 1715303 1693450 0 11:33 ? 00:00:00 /opt/seafile/seafile-server-8.0.7/seafile/bin/seafile-controller
-c /opt/seafile/ccnet -d /opt/seafile/seafile-data -F
/opt/seafile/conf
root 1715305 1693450 0 11:33 ? 00:00:05 seaf-server -F /opt/seafile/conf -c /opt/seafile/ccnet -d
/opt/seafile/seafile-data -l /opt/seafile/logs/seafile.log -P
/opt/seafile/pids/seaf-server.pid -p /opt/seafile/seafile-
server-8.0.7/runtime
root 1715433 1715303 0 11:33 ? 00:00:02 /usr/bin/python3 -m wsgidav.server.server_cli --server gunicorn
–root / --log-file /opt/seafile/logs/seafdav.log --pid
/opt/seafile/pids/seafdav.pid --port 8080 --host 0.0.0.0
root 1715440 1715433 0 11:33 ? 00:00:07 /usr/bin/python3 -m wsgidav.server.server_cli --server gunicorn
–root / --log-file /opt/seafile/logs/seafdav.log --pid
/opt/seafile/pids/seafdav.pid --port 8080 --host 0.0.0.0
root 1796716 1693527 0 13:57 ? 00:00:00 sleep 60

seafile-memcached
UID PID PPID C STIME TTY TIME CMD

systemd+ 1682604 1682581 0 10:38 ? 00:00:07 memcached -m 256

seafile-mysql
UID PID PPID C STIME TTY TIME CMD

systemd+ 1693219 1693199 0 10:55 ? 00:00:16 mysqld

My latency is on average 21ms.

Transferring with scp is extremely slow, too. Is the seafile transfer similiar to scp? I don’t have this problem using torrent-based transfer (only server and client involved).

That got me debugging further: I also checked using linux on the client-side. I could both transfer via scp and seafile full speed. So it doesn’t seem to be an server issue.

Any idea, what could make a windows-client that slow? I will try to get my hand at another windows-system to check if it’s only this system or all windows systems.

Look no further. I could not reproduce on another windows machine. Propably something messed up on the network configuration. I have no idea, why other protocols had no problems, but that is nothing for seafile to worry about.

@shoeper: Thank you for pointing me at transfering data over scp. As this was not working as expected I suspected there had to be something wrong with my local machine.

1 Like