News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Abhinav Singh's Blog:
How to use locks in PHP cron jobs to avoid cron overlaps
December 29, 2009 @ 12:45:31

In this new post from Abhinav Singh on how to use file locking to keep your cron jobs from trying to use the same resources.

Cron jobs are hidden building blocks for most of the websites. They are generally used to process/aggregate data in the background. However as a website starts to grow and there is gigabytes of data to be processed by every cron job, chances are that our cron jobs might overlap and possibly corrupt our data. In this blog post, I will demonstrate how can we avoid such overlaps by using simple locking techniques. I will also discuss a few edge cases we need to consider while using locks to avoid overlap.

He includes some sample code - both the class to create the functionality and a script showing how to make use of it (and, of course, an example of it in use).

0 comments voice your opinion now!
cron file lock tutorial


blog comments powered by Disqus

Similar Posts

Community News: Zend Releases Speaker List for ZendCon 2006

Happy Accidents: Orno Skinny Series Part 1: Building a RESTful API

Gennady Feldman's Blog: Installing Oracle Instant Client 11g and PECL OCI8 (Part 2)

HowTo Forge: Installing Lighttpd With PHP5 And MySQL Support On Fedora 7

NETTUTS.com: CodeIgniter From Scratch: Day 4 Newsletter Signup


Community Events











Don't see your event here?
Let us know!


composer podcast hack release symfony2 install application package component introduction framework facebook series security hhvm database performance language unittest opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework