我正在尝试开发一个应用程序,在该应用程序中,我将在Nutch中为urls文件提供一组受约束的urls。我能够抓取这些urls,并通过读取数据段中的数据来获取它们的内容。
我已经爬行给出了深度1,因为我没有办法关心网页中的外链或内链。我只需要urls文件中的网页内容。
但是执行这种抓取需要时间。所以,建议我一个方法来减少抓取时间和提高抓取速度。我也不需要索引,因为我不关心搜索部分。
有没有人有关于如何加速爬行的建议?
发布于 2013-01-14 23:35:33
获得速度的主要方法是配置nutch-site.xml
<property>
<name>fetcher.threads.per.queue</name>
<value>50</value>
<description></description>
</property>发布于 2011-02-04 14:43:09
您可以在nutch-site.xml中扩展线程。增加fetcher.threads.per.host和fetcher.threads.fetch都会提高爬行的速度。我注意到了巨大的改进。不过,在增加这些值时要小心。如果您没有硬件或连接来支持这种增加的流量,则爬网中的错误数量可能会显著增加。
发布于 2016-02-16 18:25:45
对我来说,这个属性帮了我很大的忙,因为一个慢的域名会减慢所有的抓取阶段:
<property>
<name>generate.max.count</name>
<value>50</value>
<description>The maximum number of urls in a single
fetchlist. -1 if unlimited. The urls are counted according
to the value of the parameter generator.count.mode.
</description>
</property>例如,如果您尊重robots.txt (默认行为),并且域太长而无法抓取,则延迟将为: fetcher.max.crawl.delay。而队列中大量的此域将减慢所有获取阶段的速度,因此最好限制generate.max.count。
您可以用同样的方式添加此属性来限制获取阶段的时间:
<property>
<name>fetcher.throughput.threshold.pages</name>
<value>1</value>
<description>The threshold of minimum pages per second. If the fetcher downloads less
pages per second than the configured threshold, the fetcher stops, preventing slow queue's
from stalling the throughput. This threshold must be an integer. This can be useful when
fetcher.timelimit.mins is hard to determine. The default value of -1 disables this check.
</description>
</property>但是,请不要触及fetcher.threads.per.queue属性,您将在黑名单中完成...这不是一个好的解决方案来提高爬行速度...
https://stackoverflow.com/questions/4871972
复制相似问题