S
S
Shakir Yakubov2020-07-17 23:50:39
JavaScript
Shakir Yakubov, 2020-07-17 23:50:39

How to speed up or run multi-threaded pupeteer?

There is a parser on puppeteer, they need to parse 60 thousand pages, in time one page takes 3.6 seconds, if converted to hours, then all this stuff will take 61 hours. Is there an option to speed up puppeteer or run it multi-threaded so as not to wait so long?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-sem, 2020-07-18
@Shakirchinskiy

1) Divide 60,000 pages into portions that are multiples of the number of instances. Each instance to feed its own bunch. Get an acceleration multiple of the number of instances.
2) Queue 60000 pages (rabbitmq, redis, db). Scripts take url to work from the queue. There are still enough resources to launch new workers. https://www.rabbitmq.com/getstarted.html
Also may be useful https://habr.com/ru/post/413547/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question