zend framework - Running PHP cronjobs in a cloud based environment -
i'm looking php solutions running cronjobs on multiple servers , guaranteeing single server runs these cronjobs automatically. have cronjobs need run once, daily digest emails or weekly reports.
right now, have "master" server has crontab installed, , multiple "normal" servers have apache installed on them. issue if "master" server fails, nobody run cronjob anymore. means need keep track on server master , it's creating scaling issues us.
are there ready-made php solutions running unique tasks multiple servers?
i have looked @ gearman (http://www.slideshare.net/felixdv/high-gear-php-with-gearman), it's little complex . need guarantee 1 server out of farm runs cronjobs.
i build concurrency , 'running' checks in scripts themselves.
update 'lock' in database or in memcached states last execution time.
if lock present, bail in other copies of script... unless lock old.
if lock has been sitting around > max_execution, script failed or ran long , never unlocked. email on condition.
remember unset lock @ script close.
Comments
Post a Comment