feapder 与 scrapy 分布式爬虫速度对比

测试用例为使用feapder的分布式爬虫与scrapy-redis爬虫,
请求1万次百度,均为32并发1进程的情况下,计算耗时

运行feapder爬虫

python3 feapder_speed.py

耗时为: 4分24秒

运行scrapy-redis

cd test_scrapy

scrapy runspider test_scrapy/spiders/baidu.py

运行结果:

{'downloader/request_bytes': 2298890,
 'downloader/request_count': 10000,
 'downloader/request_method_count/GET': 10000,
 'downloader/response_bytes': 280000,
 'downloader/response_count': 10000,
 'downloader/response_status_count/400': 10000,
 'elapsed_time_seconds': 262.985341,
 'finish_reason': 'shutdown',
 'finish_time': datetime.datetime(2022, 5, 18, 6, 20, 23, 738211),
 'httperror/response_ignored_count': 10000,
 'httperror/response_ignored_status_count/400': 10000,
 'log_count/DEBUG': 10314,
 'log_count/INFO': 20016,
 'log_count/WARNING': 2,
 'memusage/max': 72896512,
 'memusage/startup': 63176704,
 'response_received_count': 10000,
 'scheduler/dequeued/redis': 10000,
 'scheduler/enqueued/redis': 10000,
 'start_time': datetime.datetime(2022, 5, 18, 6, 16, 0, 752870)}

耗时为:262秒 = 4分22秒

结论

feapder与scrapy速度不相上下,主要耗时在于网络波动

项目地址:https://github.com/Boris-code/feapder_project/tree/master/test_speed

了解更多

知识星球 https://t.zsxq.com/eEmAeae

知识星球

星球成立1年多了,累积了python、爬虫、逆向等好多知识,欢迎大家加入

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值