Re: Fork PHP script X at a time.
| From: | raditha dissanayake | Date: | Mon, 20 Sep 2004 16:25:18 +0000 |
| Subject: | Re: Fork PHP script X at a time. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197306@lists.php.net to get a copy of this message | ||
John Wards wrote:
Hi, I have a bit of a cold today so I probably would have figured this out for myself eventually but hey ;-) Right I have a script that I need to run around 90 times thru a cron job but passing a different i.d. to it each time. not suprised.
I have experimented with running all 90 at once and its a no go as it just makes the server run to slow and the session cookies I use time out (I am doing some libcurl things). Also running them in a loop one at a time is no use because it takes about 8 hours. if your script consumes lots of CPU, lots of memory, lots of bandwidth or any combination of these you may not see a significant improvement by using threads. If you sleep you might find that the total running time will actually increase, so this is something you might want to go about carefully. PHP isn't the easiest language to use when you have to do your own threading but since others have already given good advice on the howto i will refrain from adding my 0.02-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.