A
A
Alexey Alyushenko2016-05-16 05:11:53
PHP
Alexey Alyushenko, 2016-05-16 05:11:53

What is the best way to break the script?

Hello,
There is a php script that runs phantomjs through the console, you need to parse pages every few minutes. ~500 pages, 2 seconds per page, what's the best way to split the script?
There is an idea:
1) Divide into several batches and run sequentially, the same time
2) Divide into batches, but run several tasks at once.
3) Use some handler, put the Url in the database/memory/file, and process 1 by one

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
profesor08, 2016-05-16
@profesor08

Without specifics about everything, you can only guess what you want. Do you want to do one task and do it, or do several, depends on the implementation of the script, the capabilities of the scheduler and your capabilities.

I
index0h, 2016-05-16
@index0h

Run 20 handlers through the supervisor (it won't be enough - add more), for each, allocate your own list of urls, that's all. P - Parallelization

M
Maxim Timofeev, 2016-05-16
@webinar

Is a queue server suitable? https://yandex.ru/search/?text=server%20queues%2...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question