Gestire connessioni multiple per l'host contemporaneamente
Domanda
Come posso gestire un numero di connessioni per l'host allo stesso tempo?
Soluzione
Da nutch-default.xml:
<property>
<name>fetcher.threads.fetch</name>
<value>10</value>
<description>The number of FetcherThreads the fetcher should use.
This is also determines the maximum number of requests that are
made at once (each FetcherThread handles one connection).</description>
</property>
<property>
<name>fetcher.threads.per.host</name>
<value>1</value>
<description>This number is the maximum number of threads that
should be allowed to access a host at one time.</description>
</property>
Come notato sopra, il numero di connessioni è al massimo pari al numero di fili. La prima proprietà controlla il numero totale di connessioni e il secondo il numero di connessioni per host -. Questo è quello che è necessario impostare
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow