Hey guys..... I have a PHP script that I am going to be running in the background on my server; basically what it does is gets "x" amount of results from the database & then does several tasks with the data.... each row can take between about 2 - 90 seconds to process depending on some factors.
So... I was wondering, server wise, is it more beneficial to run 5 threads of this script with each run having the task of 500 rows to process or 50 threads with each run having 50 rows to process?
Why I was wondering is because I came across this quote on another forum when I was reading about background processes..
Quote:
For example, your PHP script should put an entry into a database table and return right away. Then, a cron running every minute checks the queue and forks a process for each job.
The advantage here is that you don't lock an apache thread up for 10 minutes.
|
Thanks very much for your advice!
|