好吧,我想在linux中检查100000+url。在
这些链接实际上是我的安卓系统的OTA[zip]。在
在这些链接中只有一个有效的链接rest给出404错误。在
那么如何在linux服务器或web服务器[apache]中短时间内检查所有链接。在
URL的结构:
http://link.com/updateOTA_1.zip
好吧,我试过了
我写了这个剧本,但它真的很慢。http://pastebin.com/KVxnzttA我还将线程增加到500,然后我的服务器崩溃了:[
#!/bin/bash
for a in {1487054155500..1487055000000}
do
if [ $((a%50)) = 0 ]
then
curl -s -I http://link.com/updateOTA_$((a)).zip | head -n1 &
curl -s -I http://link.com/updateOTA_$((a+1)).zip | head -n1 &
curl -s -I http://link.com/updateOTA_$((a+2)).zip | head -n1 &
curl -s -I http://link.com/updateOTA_$((a+3)).zip | head -n1 &
curl -s -I http://link.com/updateOTA_$((a+4)).zip | head -n1 &
...
curl -s -I http://link.com/updateOTA_$((a+49)).zip | head -n1 &
curl -s -I http://link.com/updateOTA_$((a+50)).zip | head -n1
wait
echo "$((a))"
fi
done
我尝试使用aria2,但aria2上的最高线程是16,所以再次失败。在
尝试了一些在线工具,但他们给了我100url的限制。在
运行
curl
100000+次将会很慢。相反,将一批url写入curl
的单个实例,以减少启动curl
的开销。在-w
选项用于生成将每个URL与其结果关联的输出(如果需要)。在不过,我找到了使用aria2c的解决方案
现在它每分钟扫描7k网址。在
感谢大家
aria2c -i url -s16 -x16 max-concurrent-downloads=1000
相关问题 更多 >
编程相关推荐