CodeIgniter Forums
Run a big process - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Run a big process (/showthread.php?tid=15636)



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

[eluser]marcoslavorato[/eluser]
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

[eluser]obiron2[/eluser]
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

[eluser]TheFuzzy0ne[/eluser]
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.