See also Having a PHP script loop that forever performs calculations from the queue system , but this does not answer all my questions.
If I want to run a PHP script forever, calling the queue and completing tasks:
What are the potential memory problems? How to avoid them? (any flash functions or something that I should use?)
What if the script dies for some reason? What would be a good way to automatically start it again?
What is the best basic approach for running a script. Since it works forever, I don't need cron. But how do I get started? (See also 2.)
cron script. 10 . script, (,.lock). , . , .lock . - , / , .lock . , .
, , PHP script , . , .., script - .
PHP ( ) MQ, , MQ .
MQ ( ruby, perl,.NET, java ..) concurrency, , , .
, , "" (: flv2avi), "" (flv2avi 1.flv).
script (Perl), script. , , script , ; , . 1-2 , .
: (- ) ( , ) , , "", .
(vlc | ffmpeg, tail -f | grep), - , fork() ( PHP?) /bin/ bash -c "prog1 | prog2", .
: /etc/rc.d, cron ( , || 'debug')