Welcome Guest, Not a member yet? Register   Sign In
Run a big process
#1

[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?
#2

[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.
#3

[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.




Theme © iAndrew 2016 - Forum software by © MyBB