Answer the question
In order to leave comments, you need to log in
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
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.
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
Is a queue server suitable? https://yandex.ru/search/?text=server%20queues%2...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question