In Heritrix, queues are used to group URLs and to manage both the crawl budget and the communication with a web server. Queue assignment is configured through a QueueAssignmentPolicy, for example:
<bean id="queueAssignmentPolicy"
class="org.archive.crawler.frontier.HostnameQueueAssignmentPolicy">
<property name="forceQueueAssignment" value="" />
<property name="deferToPrevious" value="true" />
<property name="parallelQueues" value="1" />
</bean>
Several implementations already exist, including HostnameQueueAssignmentPolicy, DomainnameQueueAssignmentPolicy, SurtAuthorityQueueAssignmentPolicy, etc.
This policy is called from the FrontierPreparer during the CANDIDATE processing chain.
At the BnF, we also use a custom DomainnameQueueAssignmentPolicy implementation provided by NetarchiveSuite.
Problem
Web servers increasingly protect themselves against web crawlers. During our crawls, we have identified two common situations.
1. Multiple host queues targeting the same server
With the default HostnameQueueAssignmentPolicy, a large website may be split into several host queues. Although these are separate queues, they often resolve to the same physical web server. As a result, Heritrix opens multiple simultaneous connections to the same server, whereas a human user would normally use only one. This may trigger anti-bot protections, leading to permanent blocking (HTTP 403 or Heritrix status -2) or temporary rate limiting (HTTP 426 or HTTP 429). The European Union websites (europa.eu) are a typical example.
2. Site-specific politeness requirements
Some websites require significantly longer delays between requests than the default politeness configuration. For example, africultures.com and afrik.com requested a minimum interval of one minute between consecutive requests. Although Heritrix already supports site-specific politeness settings through Sheets, this mechanism only changes delay parameters and does not allow multiple queues to share the same crawl schedule.
We propose to introduce the concept of Queue Groups.
A Queue Group is a logical collection of existing queues. All queues may share the same schedule and politeness constraints but individual queues may have different budget (in terms of nb of URLs or size). Instead of scheduling each queue independently, Heritrix would schedule the entire group as a single communication channel toward a web server. Within a Queue Group, Heritrix should perform round-robin scheduling between the member queues.
For example:
- one URL from european-union.europa.eu
- then one URL from commission.europa.eu
- then one URL from data.europa.eu
...
This approach provides several benefits:
- only one active connection toward the target server;
- fair distribution of requests across all hosts;
- avoids spending too much time on a single queue while others remain idle;
- naturally skips temporarily unavailable hosts without blocking the entire crawl.
Example 1: European Union websites
Create a Queue Group named europa_eu containing:
european-union.europa.eu
commission.europa.eu
data.europa.eu
op.europa.eu
youth.europa.eu
...
The crawler should treat these queues as a single scheduling unit while continuing to alternate between the individual queues.
**Example 2: Change politeness on the EU group **
Associate the europa_eu group to a Sheet Queue Group with a Sheet redefining longer politeness delays:
<property name="minDelayMs" value="10000" />
Heritrix already provides the Sheet mechanism to override configuration values for specific SURTs, domains, hosts or URL paths. Sheets should also apply to queue groups.
Expected benefits of the combination of groups+sheets are:
- fewer HTTP 403, 426 and 429 responses
- hopefully a reduced risk of temporary or permanent blocking
- and a simpler configuration for large multi-host websites.
In Heritrix, queues are used to group URLs and to manage both the crawl budget and the communication with a web server. Queue assignment is configured through a QueueAssignmentPolicy, for example:
Several implementations already exist, including HostnameQueueAssignmentPolicy, DomainnameQueueAssignmentPolicy, SurtAuthorityQueueAssignmentPolicy, etc.
This policy is called from the FrontierPreparer during the CANDIDATE processing chain.
At the BnF, we also use a custom DomainnameQueueAssignmentPolicy implementation provided by NetarchiveSuite.
Problem
Web servers increasingly protect themselves against web crawlers. During our crawls, we have identified two common situations.
1. Multiple host queues targeting the same server
With the default HostnameQueueAssignmentPolicy, a large website may be split into several host queues. Although these are separate queues, they often resolve to the same physical web server. As a result, Heritrix opens multiple simultaneous connections to the same server, whereas a human user would normally use only one. This may trigger anti-bot protections, leading to permanent blocking (HTTP 403 or Heritrix status -2) or temporary rate limiting (HTTP 426 or HTTP 429). The European Union websites (europa.eu) are a typical example.
2. Site-specific politeness requirements
Some websites require significantly longer delays between requests than the default politeness configuration. For example, africultures.com and afrik.com requested a minimum interval of one minute between consecutive requests. Although Heritrix already supports site-specific politeness settings through Sheets, this mechanism only changes delay parameters and does not allow multiple queues to share the same crawl schedule.
We propose to introduce the concept of Queue Groups.
A Queue Group is a logical collection of existing queues. All queues may share the same schedule and politeness constraints but individual queues may have different budget (in terms of nb of URLs or size). Instead of scheduling each queue independently, Heritrix would schedule the entire group as a single communication channel toward a web server. Within a Queue Group, Heritrix should perform round-robin scheduling between the member queues.
For example:
...
This approach provides several benefits:
Example 1: European Union websites
Create a Queue Group named europa_eu containing:
european-union.europa.eu
commission.europa.eu
data.europa.eu
op.europa.eu
youth.europa.eu
...
The crawler should treat these queues as a single scheduling unit while continuing to alternate between the individual queues.
**Example 2: Change politeness on the EU group **
Associate the europa_eu group to a Sheet Queue Group with a Sheet redefining longer politeness delays:
<property name="minDelayMs" value="10000" />Heritrix already provides the Sheet mechanism to override configuration values for specific SURTs, domains, hosts or URL paths. Sheets should also apply to queue groups.
Expected benefits of the combination of groups+sheets are: