4 ms·
Thank you very much for the post. I have written a distributed crawler at my startup Semantics3* - we track the price and metadata fields from all the major eco
by netvarun 14y ago
Thank you very much for the post. I have written a distributed crawler at my startup Semantics3* - we track the price and metadata fields from all the major ecommerce sites.
Our crawler is written in perl. It uses an evented architecture (written using the AnyEvent library). We use Redis to store state (which urls have been crawled - using the hash- and determine which urls to crawl next - using sorted sets)
Instead of using a bloom filter we used sorted sets to dedupe urls and pick the highest priority urls to crawl next (some sort of priority queue).
For the actual distribution of crawling (the 'map reduce' part) we use the excellent Gearman work distribution server.
One major optimization i can suggest is caching the dns (and also do it asynchronously). You can save a lot of time and resources, especially at that scale, by simply caching dns requests. Another optimization would be to keep the socket connection open and do the download of all the pages from the same domain asynchronously.
*Shameless plug: We just launched our private beta. Please sign up and use our API using this link:
https://www.semantics3.com/signup?code=ramanujan https://www.semantics3.com/signup?code=ramanujan