π I Built a Production-Grade C++ Web Crawler That Hits 200+ Pages/Sec (Open Source!)
Hey Reddit! π
Spent the last month building a **high-performance web crawler in C++** that's actually production-ready. Think search engine infrastructure meets respectful crawling β fast, reliable, and doesn't piss off webmasters.
# πͺ Why this is different:
Most crawlers are either slow Python scripts or aggressive black boxes. This one's **built for scale** while being a good internet citizen. Perfect for building search indexes, ML datasets, content monitoring, or competitive intelligence.
# β‘ Performance specs:
* **50-200+ pages/second** sustained (benchmarked on real workloads)
* **HTTP/2 multiplexing** with connection reuse and keep-alive
* **SIMD-accelerated parsing** using AVX2 for content processing
* **Lock-free work-stealing queues** across multi-threaded workers
* **RocksDB persistence** β survives crashes, graceful shutdown with state recovery
# π€ Respectful by design:
β
Full **robots.txt compliance** β never crawls what it shouldn't
β
**Per-domain rate limiting** with exponential backoff
β
**Conditional GET** with ETag/Last-Modified caching
β
Automatic **sitemap & RSS discovery**
β
**Content deduplication** to avoid wasting bandwidth
# π οΈ Built with modern C++:
* C++17 with proper concurrency primitives
* libcurl multi-interface (HTTP/2 ready)
* RocksDB for crash-safe metadata storage
* 16-partition priority queues + 256-shard rate limiter
* Tracy profiler integration for deep performance insights
# π Real-world benchmarks:
|Setup|Workers|Throughput|
|:-|:-|:-|
|Small VPS (2 cores, 4GB)|6|\~30-50 pages/sec|
|Medium (8 cores, 16GB)|20|\~80-120 pages/sec|
|Beefy (16+ cores, 32GB+)|40+|150-200+ pages/sec|
# π― Use cases:
* Building search engine indexes
* Training data for ML/NLP models
* Content change monitoring
* SEO competitive analysis
* Archive/research projects
# π Quick start:
bashcmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
./build/crawler 8 4 50000 --max-runtime 60
Fully documented with architecture diagrams, tuning guides, operational playbooks, and performance profiling tips. Would love feedback from anyone working on crawling infrastructure or dealing with large-scale web scraping! π·οΈ
**GitHub:** [https://github.com/NotGyashu/Crawler](https://github.com/NotGyashu/Crawler)
https://redd.it/1o9ozzf
@r_cpp
Post #24079
24