Structure of a spider

    Recently I am trying to rewrite a spider of a website to download the resources on it, which supports to crawl the website daily more than 1 million pages and thousands of download, each connection cost about 10 second, and while I hold 10 processors, I could deal with 0.8 million pages per day. I wanna do all the things in python, but also MySQL is used. I always think a lot before I code, but every time when I am coding, I come out a better idea to finish the job. So I don't think too much this time, I just need to satisfy the need, and do less.

    The last version cost too much CPU time in MySQL, so here comes the new structure to low down the MySQL load, and I use a master to hold a Queue, and maintain the faults, multi-processor to get job from master, when they finish the job, they reply to the MySQL rather than reply to the master.


G.01 polling structure

    Besides, the polling pool need more new items, another part of the system is the crawl more pages which needs to be monitor. Another spider goes from some root pages, and go down the tree nodes by getting inside the links, also MySQL is used to persist data.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值