cURL은 하나를 제외한 시스템에서 매우 느립니다.

cURL은 하나를 제외한 시스템에서 매우 느립니다.

내 사무실에는 3가지 다른 설정이 있습니다. 우리는 기가비트 nat가 있는 라즈베리 파이 4, 기가비트 nat가 있는 데비안 서버, Unraid 서버를 가지고 있습니다.

처음 2개의 명령에서 컬 포스트 명령을 실행하면 약 600k만 업로드할 수 있습니다. 언레이드 박스에 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

PI

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는 동일한 명령이지만 일부 다른 명령이 포함된 파일에 있습니다. 또한 bash 스크립트를 사용하는 대신 CLI를 사용해 보았지만 동일한 결과가 나왔습니다.

/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

관련 정보