S
S
Spheniscus2017-05-07 18:46:45
MySQL
Spheniscus, 2017-05-07 18:46:45

How to speed up the parser?

The program implements the following algorithm:
- I go through the URL ( http://site/id=value)
- I get data, among which there is a "more" link
- I go through the "more" link
- I get data
- I enter the data into the database
Now the program works in 3 streams and the speed is 3-4 records to the database in 2 seconds.
There are more than 2 million pages that need to be parsed, and it will take a lot of time to go through all of them at the current speed of work.
The page is received and parsed using the HtmlAgilityPack library.
How can I speed up the work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2017-05-07
@sim3x

Run 300 Threads

T
ThunderCat, 2017-05-07
@ThunderCat

Either as sim3x advises, or there is another option - do not pour into the database, but put everything as it is into files, and parse it on the locale. The problem with the database goes away, well, temporarily, you still have to figure out what kind of jambs with the database, but the data will already be located locally, they can be parsed with something faster. And for example, save in csv, and then stupidly fill it into the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question