cURL 在系统上非常慢,除了一个

cURL 在系统上非常慢,除了一个

我的办公室有 3 种不同的设置。我们有一个带千兆位 nat 的树莓派 4、一个带千兆位 nat 的 debian 服务器和一个 Unraid 服务器。

从前 2 个命令开始运行curl post 命令只能上传大约 600k。在unraid盒子上上传超过8k。我应该注意什么来尝试确定前两个速度如此慢的原因?它们都连接到同一交换机和路由器。它显然仅限于设备本身。我在这里不知所措。

解除突袭

root@Tower:/mnt/user/Media# curl -F [email protected] https://srv-file6.gofile.io/uploadFile > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 18  463M    0     0   18 85.5M      0  6855k  0:01:09  0:00:12  0:00:57 8966k

圆周率

root@DietPiSR:/media# ./upload.sh test3.img
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  5  421M    0     0    5 22.9M      0  1114k  0:06:27  0:00:21  0:06:06  623k
[1]+  Stopped                 ./upload.sh test3.img

德班

root@Server1:/media# ./upload.sh test2.img
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  5  421M    0     0    5 12.9M      0   954k  0:08:27  0:00:15  0:08:06  413k
[1]+  Stopped                 ./upload.sh test2.img

./upload.sh 是相同的命令,但在带有一些其他命令的文件中。我也尝试过 CLI,而不是使用 bash 脚本,结果相同。

我已将其添加到我的/etc/resolv.conf文件中

options single-request-reopen

我的 DNS 设置为8.8.8.8 and 1.0.0.1

我的 Ethtool 结果 PI

root@DietPiSR:/media/unraid# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: gs
        Wake-on: d
        SecureOn password: 00:00:00:00:00:00
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

解除突袭

root@Tower:/etc# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000033 (51)
                               drv probe ifdown ifup
        Link detected: yes

我的upload.sh文件

#!/bin/bash
logdir=$HOME/log/uploads
simplekey='MYAPIKEY'
toup=${1%/}
path=$(dirname $1)"/"
if [ ! -d $logdir ]; then
    mkdir -p $logdir
fi
if [[-z $toup]]; then
    echo -e "No file to upload\n\nUsage: upload <path/to/upload>"
    exit 1;
elif [[-d $toup]]; then
    type='dir'
    filename=$(echo $toup | sed "s/.*\///")'.zip'
    7z a "/tmp/$filename" "$toup" >/dev/null
elif [[ -f $toup ]]; then
    type='file'
    filename=$(echo $toup | sed "s/.*\///")
else
    echo "$toup is not valid"
    exit 1
fi
uploadname=$(echo $1 | sed "s/.*\///")
server=$(curl -s https://apiv2.gofile.io/getServer | jq -r '.data.server')
if [[ "$type" == "dir" ]]; then
    upload=($(curl -F "[email protected]" -F "file=@/tmp/$filename" https://$server.gofile.io/uploadFile | jq -r '.data.code','.data.adminCode'))
    rm "/tmp/$filename"
else
    upload=($(curl -F "[email protected]" -F "file=@$filename" https://$server.gofile.io/uploadFile | jq -r '.data.code','.data.adminCode'))
fi

if [[ -z "${upload[1]}" ]]; then
    exit 0
else
    name=\"$filename\"
    myname=$(echo $toup | sed "s/(.*//g")
    SAVEIFS=$IFS
    IFS=$'\n'
    plot=($(curl -s "http://www.omdbapi.com/?apikey=MYAPI&t=$myname" | jq -r '.Genre,.Plot,.Year,.Runtime,.Poster'))
    IFS=$SAVEIFS
    printf "Filename: $filename\nUpload URL: https://gofile.io/d/${upload[0]}\nAdmin Code: '${upload[1]}'\n\n" | tee -a "$logdir/$filename.log"
    printf "\n" | tee -a "$logdir/$filename.log"
    printf "Name: $myname"
    link=\"https://gofile.io/d/${upload[0]}\"
    curl -s --data 'key='$simplekey'&title=Upload Ready&msg=Filename: '"$filename"$'\nDownload URL: https://gofile.io/d/'${upload[0]}$'\nAdmin Code: '${upload[1]}'&event=Uploaded' https://api.simplepush.io/send >/dev/null && echo Upload Complete
    SCRIPT_PATH="/mnt/user/discord.sh"
      eval '"$SCRIPT_PATH" --username="Gofile Upload" --color="8510795" --thumbnail="'${plot[4]}'" --footer="Your Download is Ready" --webhook-url="$WEBHOOK" --author="Gofile Upload" --description="Plot: '${plot[1]}' \nFile Name: $filename \nURL: https://gofile.io/d/'${upload[0]}$'"'
fi

相关内容