Give the possibility to create queue groups to improve politeness control
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
Research direction
Start at the FrontierPreparer CANDIDATE processing chain and trace how QueueAssignmentPolicy implementations assign and schedule queues. Then inspect the existing Sheets mechanism and frontier scheduling behavior. Done means queue groups share politeness and scheduling, rotate member queues fairly, preserve individual budgets, and accept Sheet overrides; no specific files or tests are named in the issue.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 3.4k
- Forks
- 800
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 30
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from internetarchive/heritrix3
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
internetarchive/heritrix3#801 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
internetarchive/heritrix3#800 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
internetarchive/heritrix3#799 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
internetarchive/heritrix3#795 ·
Maintainers usually reply within 1 day
-
Link extraction meta-issueMay be free again @ato claimed this 30 days ago, and no pull request is open. Open
internetarchive/heritrix3#794 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in internetarchive/heritrix3
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oracle/graalvm-reachability-metadata#12264 ·
Maintainers usually reply within 1 day
-
[BUG] AppSync: GetIntrospectionSchema wraps the schema in JSON instead of returning the raw SDL bodyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
floci-io/floci#10107 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
erkamyaman/rust-anything#1381 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day