views:

22

answers:

3

I am developing an auction site that requires maintenance scripts to be run in the background to ensure smooth running. Things such as ending auctions, starting auctions, etc...

There seem to be many options and no definite answers when I research the subject.

Is there a standard for doing this sort of thing? My research so far has uncovered these possibilities:

PHP and CRON, too slow, no evidence of anyone else using this method?

MYSQL stored procedures: don't want to deal with MYSQL language

BASH script???

C script???

I hope that someone with experience can inform me of pros and cons that I am missing, other things to think about when deciding which method to use, etc...

Speed (and efficiency) are very important.

Thanks!

A: 

This might be more of a http://serverfault.com question.

If you need something custom because the above won't work for you, pick something that uses the technologies you already have libraries and things written in, i.e. perl, python, C, php, whatever (so that you don't have to port work you've already had to do, if you need to expand it later to access things before making timing decisions), and write a custom program that does it for you. Then have cron make sure that it's always up, and it can do the more time-intensive things itself rather than in cron.

eruciform
+1  A: 

I have a site that does some pretty intensive maintenance using PHP + Cron. I would recommend that since you can reuse libraries from the main application. In what way is php too slow?

Unless you doing som serious number crunching in the application, most of the burden is on the database. In that case only Bash/cscript would have worse performance than php.

Byron Whitlock
+1  A: 

I have developed and manage a massive database system with 700+ databases [don't ask...], which need plenty of maintenance in terms of updates, summaries, synchronisation of structures, etc.

All of this is done through Bash and PHP scripts running regularly through cron. Some every 10 minutes, some hourly, some daily, some monthly - never have I had any issues with speed / performance, so long as you code the scripts and SQL statements so that they are efficient when run!

One of the most important things is to tune your MySQL indexes to ensure that your regular scheduled jobs run quickly, minimising the regular CPU hits that occur when the cron's run.

Dave Rix