aliyunpan icon indicating copy to clipboard operation
aliyunpan copied to clipboard

大文件下载速度降为0,需要手动重启的问题。

Open amsteel opened this issue 2 years ago • 4 comments

Windows 和 Ubuntu 都有这个问题。最新版和之前两个版本都有。再多的就没有测试过了。 下载大文件速度会变成 0B,然后就一直维持0B, 最长等过20+小时。最后只有重新启动命令行,重新下载,续传正常。下载超过20G的文件一般都得再手动重启一到两次。

如果下载很多小文件,则没有这个问题。测试下载总量500G的小文件,每个在2MB到100MB,可以一次运行后下载完成500G。

客户端IP在北美和欧洲。

能否检测到速度为0后一定时间,自动重启,再执行同样的或者指定的命令?

amsteel avatar Jan 19 '23 18:01 amsteel

我也这样,大佬救救,有什么自动重试下载的方法吗,

thfylsty avatar Feb 18 '23 00:02 thfylsty

国内的用户遇到类似的问题,同步一个超过20T的目录回到本地(大部分是MOVIE和DSD文件),无论是这个客户端还是运行在虚拟机中的官方桌面客户端都会一段时间后速度为0的问题.细看阿里云盘的官方问题解答,其中提及到“虽然不限速,但单次下载限制不大于1000个文件,无论大小“。是否和这个相关?如果是,可否有一个任务自动多次分段执行的方式?谢谢。

qifeng0419 avatar Feb 21 '23 03:02 qifeng0419

我搞了个脚本,用于同步的,监测网卡,速度慢了就杀了重来。

#!/bin/bash

# 保存当前运行的 aliyun 程序的 PID
pid=

count=0
while true; do
  count=$((count + 1))

  # 使用 ifconfig 命令获取网络接口 eth0 的接收流量统计信息
  rx_bytes=$(ifconfig enp6s18 | awk '/RX packets/ {print $5}')

  # 等待 10 秒钟,然后再次获取网络接口的接收流量统计信息
  sleep 10
  new_rx_bytes=$(ifconfig enp6s18 | awk '/RX packets/ {print $5}')

  # 计算两次获取的接收流量差值,即 10 秒内的接收流量
  rx_speed=$((($new_rx_bytes - $rx_bytes) / 10))
  echo "nowspeed" $rx_speed >> log.txt
  # 判断当前带宽下行速度是否低于 2M/s
  if [ $rx_speed -lt 2000000 ]; then  
    echo "low than thread " 
    echo "low than thread " >> log.txt
    # 如果当前正在运行 aliyun 程序,则杀死它
    if [ -n "$pid" ]; then
      echo "Download speed is less than 2 MB/s, killing current aliyun process..."
      kill -9 $pid
      sleep 5
    fi

    # 启动 aliyun 程序,并保存它的 PID
    echo "Starting new aliyun process..."
    ./aliyunpan sync start -dp 4 -up 2 -dbs 2048 -ubs 2048 &
    pid=$!
  fi

  # 等待 30 分钟,然后再次检查带宽速度
  sleep 30m

  echo "########### Loop $count completed. ########### " `date`
  echo "########### Loop $count completed. ########### " `date` >> log.txt
done


thfylsty avatar Feb 28 '23 06:02 thfylsty

搞了个没啥技术含量,粗暴的python脚本,每三小时重启一下。 import subprocess

while True: try: subprocess.check_call(['aliyunpan.exe', 'd', '*'], timeout=10800) except subprocess.TimeoutExpired: print('subprocess has been killed on timeout') else: print('subprocess has exited before timeout') break

amsteel avatar Mar 02 '23 16:03 amsteel