Replies: 1 comment
|
Hi @niteshver at a scale of 1M+ URLs, there are a few things you should keep in mind:
dispatcher = MemoryAdaptiveDispatcher(
memory_threshold_percent=75.0,
recovery_threshold_percent=65.0,
max_session_permit=20, # concurrent pages, tune per machine
rate_limiter=RateLimiter(base_delay=(0.5, 1.5), max_retries=3),
)It pauses new tasks when system memory crosses the threshold and resumes below recovery. The rate limiter is per domain and backs off on 429/503.
BrowserConfig(
headless=True,
text_mode=True, # no images/fonts/JS; drop if you need JS
light_mode=True,
memory_saving_mode=True, # cache discard + 512 MB V8 heap cap
max_pages_before_recycle=500, # restart Chromium every N pages to shed leaks
)If pages are server-rendered, skip Chromium entirely: AsyncWebCrawler(crawler_strategy=AsyncHTTPCrawlerStrategy()). Do an HTTP pass first, then re-queue only the empty results for a browser pass.
|
Uh oh!
There was an error while loading. Please reload this page.
Discuss how to crawl 1M+ URLs efficiently while keeping memory usage low, focusing on URL queues, deduplication, concurrency, storage, and memory management.
All reactions