Webdav module download speed slow

1. Caddy version (caddy version):

2.3.0

2. How I run Caddy:

Download caddy server from https://caddyserver.com/download and add “github.com/mholt/caddy-webdav” modules.

a. System environment:

RaspberryPi4, 4g, ubuntu 20.04

webdav client is winscp v5.17.8

b. Command:

sudo -u user1 -g user1 /home/ubuntu/app/caddy/caddy start --config /home/ubuntu/app/caddy/Caddyfile > /home/ubuntu/app/caddy/log.log 2>&1 &

c. Service/unit/compose file:

d. My complete Caddyfile or JSON config:

{
http_port 8880
order webdav before file_server
}

192.168.1.111:8880 {
rewrite /dav /dav/
webdav /dav/* {
root /media/sda1/user1/pi
prefix /dav/
}

redir /pi    /pi/
file_server	/pi/*	browse {
            root	/media/sda1/user1
    }

    basicauth /* {
            user1    xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    }

}

3. The problem I’m having:

I connect raspberrypi via Gigabit wired connection. when download from file
_server. speed is about 90-100M, when download from webdav module, most of the time speed about only 60M, a few times can up to 90-100M.

5. What I already tried:

I try write a webdav server :

package main
import (
“net/http”
golang.org/x/net/webdav
)

func main() {
http.ListenAndServe(":8080", &webdav.Handler{
FileSystem: webdav.Dir("."),
LockSystem: webdav.NewMemLS(),
})
}

download speed is about 90-100M every time.

6. Links to relevant resources:

Hmm I’m not sure! I wonder if that’s something to do with the webdav protocol, or maybe the upstream webdav library isn’t as optimized as Go’s standard HTTP file serving code.

You can probably capture a memory/CPU profile during a transfer and see where most of the time is spent.

This topic was automatically closed after 30 days. New replies are no longer allowed.