Same function needs to be called simultaneously for all users in php -
i have start_processing("set 1")
function takes 6 hrs complete set1,
i want process set 2, set 3 .... how can process of them in same time ?? since when put
<?php start_processing("set1"); start_processing("set2"); start_processing("set3"); ?>
it takes 18 hrs.
i want complete process in 6hrs processing.
finally got solution
i have take curl_multi - far better. save handshakes - not needed every time!
use curl_multi_init run processes in parallel. can have tremendous effect.
unless using php apache-module, can use pcntl_fork create several processes of each processes 1 function call.
if(pcntl_fork()) start_processing("set1"); else if(pcntl_fork()) start_processing("set2"); else start_processing("set3");
if have varying number of working sets, put them in array , loop through it. bear in mind many processes overload system!
another, more lightweight, option use of php pthreads afaik work apache, require installing corresponding php-extension first.
a third possibility is, mentioned sandeep_kosta , niranjan n raju, create 1 cronjob each working set.
Comments
Post a Comment