Visit billions of pages politely: a frontier of URLs, duplicate detection and traps.
βDesign a web crawler.β
It is short on purpose. Your first job is to make it specific.
| What they check | Why it matters |
|---|---|
| Turning a vague prompt into a scope | A crawler for a search engine, for price tracking and for a one-off scrape are three different systems. A strong candidate asks which one, and how fresh the data must be. |
| Politeness as a design constraint | The hard part is not fetching pages. It is fetching them without hammering any single site. That shapes the whole queue design. |
| Avoiding repeated work | The web links to itself in loops. URL de-duplication, content de-duplication and traps decide whether the crawl finishes or wastes its budget. |
| Estimation that drives decisions | Pages per second, bytes per month, and the size of the seen-URL set tell you how many machines you need and whether a Bloom filter is worth it. |
| Scaling and failure handling | Fetchers die, sites time out and the frontier is huge. You must say what is checkpointed, what is retried and why re-doing work is safe. |
A crawler is a loop: take a URL from the frontier, fetch the page, store it, pull out its links, throw away the ones already seen, and put the new ones back in the frontier. The design is about making that loop polite, duplicate-free and restartable at billions of pages.
| Step | Minutes | What to get done |
|---|---|---|
| 1. Clarify | 4 | Purpose, scale, freshness, content types. Say what you will not crawl (JavaScript-heavy pages). |
| 2. Estimate | 3 | Pages per second, storage per month, URL set size, fetcher count. |
| 3. API and data | 4 | Internal contracts (frontier, fetch result) and the URL record. There is no public API. |
| 4. High-level design | 8 | Seeds, frontier, DNS, fetchers, parser, de-duplication, storage, recrawl scheduler. |
| 5. Deep dives | 16 | The frontier and politeness, de-duplication, traps, then freshness and fault tolerance. |
| 6. Scale and failures | 7 | Hot hosts, DNS, dead fetchers, monitoring, being blocked. |
| 7. Wrap up | 3 | Recap, trade-offs, what you would add next. |
| Ask | Why you ask it | Typical answer | How it changes the design |
|---|---|---|---|
| What is the crawler for: a search index, price tracking, or a one-off data grab? | A search crawler runs forever over the whole web. A one-off scrape is small and can be much simpler. | Feeding a search engine. It runs continuously. | We need a persistent frontier, recrawl scheduling, and a lot of attention to politeness. |
| How many pages, and how fast? | Sets the number of fetchers, the storage size and whether one machine could do it. | About 1 billion pages a month. | About 400 pages per second, so tens of fetcher machines and a partitioned frontier. |
| How fresh must the data be? Do we recrawl? | Recrawling is a second job that competes with discovering new pages. | Yes. News pages within hours, most pages within weeks. | Per-page recrawl intervals based on how often a page changes, plus conditional GET. |
| What content do we fetch: HTML only, or images, PDFs and JavaScript-rendered pages? | Rendering JavaScript needs a headless browser, which is many times more expensive than a plain fetch. | HTML first. Other types and JavaScript rendering later. | A simple async HTTP fetcher now. A separate, small rendering pool is an extension. |
| Do we obey robots.txt and a crawl delay? | Politeness decides the queue design. Ignoring it gets you blocked. | Yes. Respect robots.txt and never overload a site. | A cached robots.txt per host and a per-host queue with a minimum gap between requests. |
| Do we store the raw page or only the extracted text? | Raw HTML is big. Keeping it lets you re-parse later. | Store the raw page, compressed, and send extracted text on to the indexer. | Object storage for pages, about 25 TB a month after compression. |
| How do we treat duplicate and near-duplicate pages? | Mirrors and copied articles waste storage and pollute search results. | Skip exact duplicates. Detect near-duplicates and keep one. | A content hash for exact copies and SimHash or MinHash for near copies. |
| What are we allowed to crawl: one language, one country, or the whole web? | A narrow crawl is far smaller and may allow a depth limit. | The public web, any language. | No topic filter. We still cap depth and URLs per host to avoid traps. |
| Is the crawl run from one data centre? | Multiple regions change how the frontier is partitioned and how bandwidth is bought. | One region first. | Partition by host across machines in one region. Multi-region is a later phase. |
| Assumption | Value |
|---|---|
| Pages crawled | 1 billion a month |
| Average page size | 100 KB of HTML |
| Compression for storage | about 4 to 1 |
| Peak factor | 2 times the average |
| Links per page | about 50 |
| URLs known (crawled and queued) | about 5 billion, five times the monthly crawl |
| Fetcher speed | about 20 pages per second per machine (about 1 second a page, 20 in flight) |
| Politeness gap | one request per host every 2 seconds |
| DNS cache miss rate | about 5% |
| What | Maths | Result |
|---|---|---|
| Seconds in a month | 30 Γ 86,400 | about 2.6 million |
| Pages per second, average | 1 billion Γ· 2.6 million | about 390, call it 400 |
| Pages per second, peak | 400 Γ 2 | 800 |
| Raw content per month | 1 billion Γ 100 KB | 100 TB |
| Stored per month (compressed) | 100 TB Γ· 4 | 25 TB |
| Stored for a year, with erasure coding | 25 TB Γ 12 = 300 TB; Γ 1.5 | about 450 TB |
| Download bandwidth | 400 Γ 100 KB = 40 MB/s; Γ 8 | about 320 Mbit/s (640 at peak) |
| Links found per second | 400 pages Γ 50 links | 20,000 (40,000 at peak) |
| URL records | 5 billion Γ 200 bytes | about 1 TB |
| Seen-URL Bloom filter | 5 billion Γ 10 bits Γ· 8 | about 6.25 GB (about 0.8% false positives) |
| Fetcher machines | 800 pages/s Γ· 20 per machine | 40 machines at peak |
| Hosts active at once | 800 pages/s Γ 2 s gap | at least 1,600 hosts, or we run out of polite work |
| DNS lookups that miss the cache | 400 Γ 5% | about 20 per second |
| Method | Path | Request | Response | Notes |
|---|---|---|---|---|
| POST | /frontier/next | { fetcherId, max: 20 } | 200 { leases: [{ url, host, leaseId, expiresAt }] } | Hands out URLs whose host is allowed now. Each is a lease, not a delete. If the fetcher dies, the lease expires and the URL goes back. |
| POST | /frontier/done | { leaseId, status, contentHash, newLinks[], nextCrawl } | 204 | Idempotent. Marks the lease finished. A repeat with the same leaseId changes nothing. |
| POST | /frontier/add | { urls[], sourceUrl, depth } | 202 { accepted } | Called by the link extractor. Each URL is normalised, filtered and checked against the seen set before it is queued. |
| GET | /robots/{host} | none | 200 { rules, crawlDelay, fetchedAt } | Served from a cache with a TTL (about 24 hours). A missing file means everything is allowed. A 5xx means treat the host as off limits for now. |
| PUT | /seeds | { urls[], priority } | 202 | Operator call to add seed URLs or boost a site. |
| URL record | Type | Notes |
|---|---|---|
| url_hash | 64-bit hash of the normalised URL | Primary key. Keeps rows small and lookups fast. |
| url | string, up to about 2 KB | The normalised form: lower-case host, no fragment, sorted query, tracking parameters removed. |
| host | string | Partition key for the frontier, so one host lives on one worker. |
| state | new, queued, fetching, done, error | Move through states with a lease so a crash returns the URL to queued. |
| priority | integer | From importance (links in, past rank), change rate and depth. |
| depth | integer | Hops from a seed. Capped to escape traps. |
| last_crawled / next_crawl | timestamps | Recrawl schedule. |
| content_hash / simhash | bytes / 64-bit | Exact and near-duplicate detection. |
| etag / last_modified | strings | Used for conditional GET. |
| fail_count | integer | Back off and finally drop URLs that keep failing. |
| Other state | Holds | Where |
|---|---|---|
| Frontier queues | URLs waiting, grouped by priority and by host | In memory with a disk-backed log on each frontier worker |
| Seen-URL filter | A Bloom filter over every URL ever queued | Memory on each frontier worker (its share of hosts) |
| Page store | Compressed raw HTML, one object per page version | Object storage, in large files (WARC style) |
| Link graph | Edges from a page to the pages it links to | Wide-column or batch store, used for ranking later |
| Robots and DNS caches | Parsed rules and host to IP answers, with TTLs | Memory on each fetcher, backed by a shared cache |
POST /frontier/done
{
"leaseId": "L-8f3a",
"status": 200,
"contentHash": "a41c...",
"newLinks": ["https://example.org/a", "https://example.org/b?id=7"],
"nextCrawl": "2026-12-11T06:00:00Z" // sooner if the page changed since last time
}| Component | What it does |
|---|---|
| Seed URLs | Where the crawl starts: a hand-picked list of good sites, plus sitemaps. Seeds are also a quality lever. |
| URL frontier | Holds every URL waiting to be fetched. Front queues sort by priority. Back queues give each host its own queue and a timer, which enforces politeness. |
| Fetchers | Asynchronous workers that download pages. They lease URLs, honour timeouts and redirect limits, and use cached DNS and robots.txt. |
| DNS and robots caches | Avoid a lookup for every page. A hostβs robots.txt is fetched once and reused for about a day. |
| Parser and link extractor | Parse HTML (even broken HTML), pull out text and links, and normalise each link. |
| Seen-URL filter | A Bloom filter says βdefinitely newβ or βprobably seenβ. An exact store can confirm. Stops the same URL entering the frontier twice. |
| Content de-duplication | A hash catches exact copies. SimHash or MinHash catches near copies, so mirrors are stored once. |
| Page store | Compressed raw pages in object storage, packed in big files. Metadata stays in the URL table. |
| Recrawl scheduler | Re-adds a URL when it is due, sooner for pages that changed last time. Uses conditional GET to make repeat fetches cheap. |
The problem: We have billions of URLs waiting. The next one to fetch must be important, and it must belong to a site we have not hit in the last few seconds. A plain queue gets one of these wrong.
| Option | How it works | Good | Bad |
|---|---|---|---|
| One global FIFO queue | Take URLs in the order they were found. | Trivial. Breadth-first by accident. | Pages link to their own site, so a burst of links from one host arrives together and that host is hammered. No priority at all. |
| Global queue, wait for the host | Take the head of the queue and wait if its host was hit recently. | Polite. | Head-of-line blocking: every free fetcher waits behind one resting host while other sites have work. Throughput collapses. |
| Front queues by priority, back queues per host | A router puts each URL in a priority queue, then moves it to the single back queue for its host. A heap holds the time each back queue may next be used. | Polite, busy and priority-aware. This is the classic design (Mercator). | More moving parts. The number of back queues must track the number of active hosts. |
| Per-host queues with a token bucket per host | Each host gets a queue and a rate limit. A scheduler picks any host that has a token. | Easy to allow faster crawling of sites that ask for it. | Needs a fair scheduler across millions of hosts, or it favours big sites. |
The frontier is two layers. Front queues are ordered by priority (how important the page is, how often it changes, how shallow it is). A router drains them into back queues, where each host has exactly one queue. A min-heap keyed by "the time this host may next be hit" tells the frontier which back queue is ready. A fetcher takes the ready queue at the top, pops one URL, and the host's timer is set to now plus the gap (or the Crawl-delay in robots.txt, whichever is larger).
This answers both problems. No host is ever hit early, because only ready hosts are eligible. No fetcher waits behind a resting host, because it simply takes the next ready one. The visualizer after the deep dives shows the three designs side by side. For the heap see Heap and Priority Queue.
| Layer | Keyed by | Job |
|---|---|---|
| Front queues (say 3 to 5) | Priority | Make sure important and fast-changing pages go first. |
| Router | Host | Moves a URL from a front queue to the back queue of its host. |
| Back queues (one per active host) | Host | Keep each hostβs URLs together, in order. |
| Ready heap | Next allowed time | Says which back queue may be used now. |
The problem: The same page can be reached by many URLs, and the same text can live at many pages. With 20,000 new links a second, we must drop repeats cheaply, without losing pages we have not seen.
| Option | How it works | Good | Bad |
|---|---|---|---|
| Exact set of every URL | A database or hash set stores every URL ever seen. | Never wrong. | About 1 TB of records for 5 billion URLs, and a lookup for each of 20,000 links a second. |
| Bloom filter in memory | Hash each URL into several bits of a bit array. All bits set means probably seen. | About 6 GB for 5 billion URLs at 10 bits each. Microsecond checks. No false negatives. | A false positive (about 0.8% here) says βseenβ for a new URL, and that page is skipped. Cannot delete. |
| Bloom filter, then an exact check | Use the filter as a fast gate. Only ask the exact store when the filter says βseenβ. | No page lost to false positives. Most lookups still cost nothing. | About 1% of lookups hit the slower store. Two systems. |
| Normalise first, then dedup content | Canonicalise the URL before any check. After fetching, fingerprint the content. | Catches the same page under many URLs, and mirrors under different hosts. | Content checks happen after the fetch, so the bandwidth is already spent. |
Three layers, each cheap enough for its place. URL normalisation makes equal URLs look equal: lower-case the host, drop the fragment (#top), remove default ports, sort query parameters, strip tracking parameters, resolve /a/../b. The Bloom filter then rejects most known URLs without touching a disk. Content fingerprints catch what URLs cannot: a hash for exact copies, and SimHash (or MinHash) for near copies, where two pages are the same text with a different header or ad.
The Bloom filter trade-off is worth saying out loud. It has no false negatives, so we never re-crawl by accident. It has false positives, so with 10 bits per URL about 0.8% of new URLs look "seen" and are skipped. For a search crawl that is acceptable, because the page usually has other inbound links and gets another chance. If it is not, confirm "seen" in the exact store. See Bloom Filters and MinHash.
| Bits per URL | Hashes | False positives | Memory for 5 billion URLs |
|---|---|---|---|
| 8 | 6 | about 2.2% | 5 GB |
| 10 | 7 | about 0.8% | 6.25 GB |
| 20 | 14 | about 0.007% | 12.5 GB |
https://Example.COM:443/a/../b/index.html?utm_source=x&id=7&a=1#top lower-case scheme and host -> https://example.com:443/... drop default port -> https://example.com/... resolve dot segments -> /b/index.html remove fragment -> (no #top) drop tracking parameters -> ?id=7&a=1 sort remaining parameters -> ?a=1&id=7 result: https://example.com/b/index.html?a=1&id=7
The problem: Some sites generate an endless supply of URLs: a calendar with a next-month link forever, session IDs in every link, filters that combine in millions of ways. A naive crawler follows them until its budget is gone.
| Option | How it works | Good | Bad |
|---|---|---|---|
| Do nothing | Follow every link. | Simple. | One trap site can eat most of the crawl and fill storage with junk. |
| Hard limits | Cap the depth, the URL length, and the number of URLs per host. | Simple and effective against most traps. | A very large legitimate site is cut short. Limits need tuning. |
| Pattern detection | Notice repeated path segments or a growing parameter, and stop following that pattern. | Catches the loops that hard limits miss. | Heuristics can misfire. More code. |
| Quality score per host | Track how many pages from a host are new, unique and useful. Lower the priority of hosts that give mostly duplicates. | Adapts to traps nobody predicted. | Needs content signals and time to learn. |
Start with cheap limits that stop most damage: a maximum depth from the seed (say 15), a maximum URL length (say 2,000 characters), and a maximum number of URLs per host per day. Add rules for the known shapes: the same path segment repeated three times, a parameter that grows (?page=1001 and up), or session IDs, which normalisation strips. Then add feedback: if a host keeps returning duplicate or empty pages, its priority drops, so the crawl moves on.
The same section covers bad pages. Set timeouts on connect and on read, limit the page size (say 10 MB), limit redirect hops (say 5) and detect redirect loops, and treat malformed HTML as normal, because the web is full of it. Honour robots.txt, and treat a server error on that file as "do not crawl yet". Be careful with nofollow and with each site's terms.
| Trap or problem | Looks like | Defence |
|---|---|---|
| Infinite calendar | /cal/2031/05, /cal/2031/06, and on | Depth cap, per-host daily cap, pattern rule |
| Session IDs in links | /page?sid=84f1, a new value every visit | Strip known session parameters when normalising |
| Faceted filters | /shop?color=red&size=m&sort=price&page=9 | Cap parameters per URL, quality score drops the host |
| Redirect loop | A to B to A | Hop limit and loop detection |
| Huge or slow response | A 2 GB file, or a server that sends a byte a second | Size limit, total timeout |
| Spam link farms | Thousands of generated pages linking to each other | Quality score, blocklist, lower priority |
The problem: A crawl that never revisits goes stale, and one that revisits everything blindly wastes its budget. We also have to survive machines dying in the middle of work.
| Option | How it works | Good | Bad |
|---|---|---|---|
| Recrawl everything on a fixed cycle | Every page, every 30 days. | Easy to reason about. | Wastes work on pages that never change, and is too slow for news. |
| Adaptive interval | Shorten a pageβs interval when it changed since the last visit, and lengthen it when it did not. | Spends effort where change happens. | Needs a change signal (a hash) and a model. New pages start with a guess. |
| Priority by importance | More important pages are revisited more often, whatever their change rate. | Good for popular sites. | Wastes effort on important but static pages. |
| Push signals | Use sitemaps, feeds and change pings to learn about updates. | Cheapest and fastest when a site supports it. | Many sites do not. A signal can be wrong. |
Each URL has a next_crawl time. After a fetch, compare the new content hash to the old one. If it changed, halve the interval (down to a floor, say 1 hour for news). If it did not, double it (up to a cap, say 30 days). Multiply the urgency by importance so popular pages are checked more often. Use conditional GET (If-None-Match with the ETag, If-Modified-Since with the date), so a page that has not changed comes back as a tiny 304 reply instead of 100 KB. Sitemaps tell us about new URLs and last-modified times, so we can skip guessing.
For fault tolerance, nothing is deleted when handed out: a fetcher takes a lease with an expiry. If it dies, the lease runs out and the URL returns to the queue. Every step is safe to repeat: fetching twice stores the same content hash, and the done call is idempotent by lease ID. The frontier keeps a write-ahead log and periodic checkpoints, so a frontier worker that restarts rebuilds its queues, and its hosts can move to another worker through consistent hashing. See Idempotency and Handling Failures.
| Visit | Page changed? | New interval |
|---|---|---|
| Start | unknown | 24 hours (a guess) |
| 1 | yes | 12 hours |
| 2 | yes | 6 hours |
| 3 | no (304) | 12 hours |
| 4 | no (304) | 24 hours |
| 5 | no (304) | 48 hours, and so on up to a cap |
A Bloom filter answers "have I seen this URL?" with a few bits per URL. It can say "seen" for a URL it has never seen (a false positive), and that page is then never crawled. It never says "new" for a seen URL.
Standard formula: k = bits Γ ln 2 hashes, false-positive rate (1 β e^(βk/bits))^k. The exact store assumes 100 bytes per URL (an assumption). Real crawlers often confirm a "seen" answer in an exact store when it matters.
A simplified model with fixed numbers (no random values): four sites, 34 URLs discovered in bursts, one request per site at a time, one second per tick. Latencies and priorities are illustrative.
| Bottleneck | Fix |
|---|---|
| Politeness caps throughput (not enough different hosts with work) | Seed broadly, keep many hosts active, and raise the rate only for hosts that allow it. Add fetchers last. |
| DNS lookups slow every fetch | A local DNS cache on each fetcher, a shared resolver cache, and prefetching the host of queued URLs. |
| The seen-URL check at 20,000 links a second | A per-worker Bloom filter for the hosts that worker owns, so the check is local and needs no network call. |
| One huge host dominates a frontier worker | Split a very large hostβs queue across several back queues that share one timer, or give it its own worker. |
| Page storage grows by 25 TB a month | Write large batched files to object storage, compress, use lifecycle rules, and keep only the latest version of unchanged pages. |
| Parsing is CPU heavy | Separate parser workers fed by a queue, so fetchers stay I/O bound and parsing scales on its own. |
| Outbound bandwidth peaks at 640 Mbit/s | Spread fetchers across several network links, and throttle low-priority recrawls at peak. |
| Failure | How the design copes |
|---|---|
| A fetcher crashes mid-download | Its leases expire and the URLs go back to the queue. Fetching again is safe because storing is idempotent. |
| A frontier worker dies | Its hosts are reassigned by consistent hashing. It rebuilds from its log and last checkpoint. Some URLs are fetched twice, never lost. |
| A site is down or very slow | Timeouts, then exponential back-off for that host, and the host is moved down in priority until it recovers. |
| robots.txt cannot be fetched (server error) | Treat the host as off limits for a while, and retry later. Do not assume permission. |
| Object storage write fails | Retry with the same object key. Do not mark the URL done until the page is stored. |
| A site blocks us or returns many 403 and 429 replies | Slow down at once, lengthen the gap, and honour Retry-After. Do not rotate addresses to get around a block. |
A crawler is a loop over a frontier. The frontier has priority queues in front and one queue per host behind them, so it is both important-first and polite. Fetchers lease URLs and use cached DNS and robots.txt. Every link is normalised and checked in a Bloom filter, and every page is fingerprinted for duplicates. Pages go to object storage. A scheduler recrawls pages on adaptive intervals using conditional GET. Everything is leased and idempotent, so failures only repeat work.
| Decision | What we gain | What it costs |
|---|---|---|
| Back queues per host with a ready heap | Polite and busy, with priorities | More complex than a single queue, and it needs a host-to-worker mapping |
| Bloom filter for seen URLs | About 6 GB, microsecond checks, no repeats | Under 1% of new URLs are skipped by mistake |
| HTML only, no JavaScript rendering | Cheap and fast, about 20 pages a second per machine | Pages built in the browser are missed or thin |
| Leases instead of deleting on hand-out | A crash loses nothing | Some pages are fetched twice, so every step must be idempotent |
| Adaptive recrawl intervals | Effort goes where pages change | A change model to maintain, and a bad guess for new pages |
| Partition the frontier by host | Politeness needs no locks | A very large host can overload one worker |
The first thing most interviewers probe. Explain why a simple queue fails.
A change in requirements is a test of whether you understand why your design looks the way it does.
| New requirement | What changes in the design |
|---|---|
| Crawl only one site (or a few), not the whole web | No need for a Bloom filter or a partitioned frontier. One queue per host and a database for seen URLs is enough. Depth and politeness still apply. |
| Pages must be fresh within minutes | A fast lane: feeds, sitemaps and push signals, a short recrawl interval for hubs, and a fixed share of the fetch budget reserved for it. |
| Most pages need JavaScript to render | A headless-browser pool becomes the main fetch path. Cost per page rises many times, so the crawl rate falls or the fleet grows, and caching of rendered output matters. |
| Crawl images and video too | A separate pipeline by content type, a bigger store, different size limits, and a thumbnail or hash step. Usually done by a second crawler fed from page links. |
| Crawl from several regions | One frontier per region, each owning the hosts nearest to it. Shared seen-URL information is synchronised in the background, and the page store is replicated or kept per region. |
| Must obey a legal takedown quickly | A deny list consulted by the frontier and the indexer, a way to find and delete stored copies by URL, and an audit log of removals. |
| The target is a private or login-protected site | Out of scope here. It needs credentials, session handling and permission from the owner, and a much more careful rate. |
| Area | Weak | Good | Great |
|---|---|---|---|
| Requirements | Starts drawing without asking what the crawler is for. | Asks scale, freshness and content types, and states robots.txt. | Ties each answer to a design choice, and rules out JavaScript rendering with a reason. |
| Estimation | No numbers, or a machine count with no basis. | Pages per second, storage per month, and fetcher count. | Also sizes the seen-URL filter, link rate and active hosts needed, and says what each number means. |
| Frontier and politeness | One FIFO queue. | Per-host queues and a delay. | Front and back queues with a ready heap, host partitioning, and an explanation of head-of-line blocking. |
| De-duplication | A visited list in a database. | Normalisation and a Bloom filter. | Quantifies the false-positive trade-off, adds an exact check, and covers near-duplicates with SimHash. |
| Traps and robustness | Does not mention loops or bad pages. | Depth and size limits, timeouts, robots.txt. | Adds pattern detection, a host quality score and redirect handling, with the reasoning. |
| Failures and ethics | Assumes nothing fails. | Leases, retries and idempotent steps. | Adds checkpoints, recovery of frontier workers, and a clear stance on blocking and the law. |
| Mistake | Do this instead |
|---|---|
| Using one global queue and ignoring politeness | Give each host its own queue and timer, and say why a single queue hammers sites or blocks fetchers. |
| Checking seen URLs with a database query per link | Use an in-memory Bloom filter at 20,000 links a second, with an exact store behind it when needed. |
| Not normalising URLs | Canonicalise first, or the same page enters the frontier under many forms. |
| Forgetting traps | Name the calendar and session-ID cases, and add depth, length and per-host caps. |
| Handing out URLs by deleting them | Use leases with an expiry, so a crash does not lose work. |
| Rendering JavaScript for every page | Fetch plain HTML first, and use a small headless-browser pool only where needed. |
| Ignoring robots.txt and legal limits | Obey robots.txt, crawl-delay and takedowns, and say you would involve legal counsel. |
| Adding fetchers when throughput is low | Check the number of active hosts first. Politeness is usually the limit, not machines. |
The in-memory seen-URL check and its false-positive trade-off.
Near-duplicate detection for page content.
The ready heap that picks the next polite host.
Partitioning the frontier by host across workers.
Why lookups are a bottleneck and need caching.
Where the compressed raw pages live.
The same idea as a per-host politeness gap.
What to do when the parser cannot keep up with the fetchers.