CodeIgniter Forums
Run a big process - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Run a big process (/thread-15636.html)

Run a big process - El Forum - 02-10-2009

Hi everyone, how are you?

I have a big problem with my project. I need to ping a list with 300 feeds and save in my database every hour (I will use the cronjob). But, how is the best method to do that without overload my server and database?

Run a big process - El Forum - 02-11-2009

I would store the list of feeds in a database table with the last time they were pinged

I would set up the cron job to find the oldest X feeds where the time stamp is < 60 minutes and to ping them in sequence and then update the date time.

If the select statement returns no records, then the cron job doesn't need to run.

You can them play around with the timing of the cron job and the number of records to be returned to determine a suitable load on the server.

Run a big process - El Forum - 02-11-2009

I second that. I was thinking the exact same things when I first saw this post, but I was trying to figure out if there was a better way.

You can also use sleep() if you need to during your processing, although I doubt you'll need to.