Post view

The Crons in Dolphin 7

I have been thinking about Dolphin 7 crons. During installation you are asked to set a cron to run every minute. I don't know if that is such a good idea for most environments especially sites on shared hosting.

The Dolphin 7 installer will tell you to set a cron to something like:
* * * * * cd /home/your-account/public_html/periodic; /usr/local/bin/php -q cron.php
* * * * * /usr/local/bin/php -q /home/your-account/public_html/periodic/cron.php

Or something similar depending on your hosts setup and configuration.

The 5 *'s (* * * * *) means run the cron every minute.

Now on top of that 1 cron.php running or popping off every 1 minute if you look in the database table: sys_cron_jobs you will see in this very simple basic Dolphin 7 setup with very few modules installed yet I have 4 crons that will go off when cron.php is processed.

Dolphin 7 Crons

The first one happens at 12:00am server time. (0 0 * * *)
The second one happens every 10 minutes. (*/10 * * * *)
The third one happens every 1 minute. (* * * * *)
The fourth one happens every 5 minutes. (*/5 * * * *)

All of this happening on top of the main cron.php that happens every 1 minute, and with very few modules installed yet.

Most shared hosts will not exactly be excited about you running this every minute. Some shared hosts only allow crons every hour. Some will even change your 1 minute cron to 1 hour if they happen to notice something like this. It's their server not yours so if you see your cron job change this might be why.

Now imagine a host that specializes in Dolphin hosting like Arvixe, TMD, Joombyte, or Terrabyte-Hosting for example. If they had 100 accounts each with Dolphin installed and running a cron every 1 minute that is 100 crons every minute. Then, take into consideration some people have 2, 3, or more Dolphin setups installed. Now you are talking 200, 300, or more crons happening every minute. Way too much, and a big waste of server resources.

In fact most Dolphin sites don't even have anything happening every minute that they would need a cron to go off that frequently. Those that do should probably be on a VPS or Dedicated server anyway.

I would consider setting cron.php to a more reasonable setting of 1x per hour, every 30 minutes, every 20 minutes, every 15 minutes, or possibly every 10 minutes. Heck even every 5 minutes would be less resource intense as the default 1 minute setting.

It kind of depends on what you have going on, but most sites especially those that are new and getting started really don't need a cron every 1 minute.

I have this site set to every 20 minutes right now, but I am probably going to raise it up to once every 30 minutes or once every 1 hour soon.

I just don't see the point of wasting server resources and power for a cron job that usually isn't doing anything that often anyway.

Something to think about and consider. Like I said some shared hosts will complain or adjust your cron without your knowledge anyway if you run it every minute. Shared hosting can be regulated heavily, and they will not let 1 site abuse the server resources for $4-$8 per month in hosting fees.

3112 Awesome Views
Post info
05.01.2010 (4539 days ago)
Sponsored Links
Yahoo and MSN (16 posts)
Alexa (3 posts)
Articles (1 posts)
Boonex (79 posts)
Boonex DolphinU (1 posts)
Dedicated Servers (2 posts)
Dolphin Pro (3 posts)
Google (25 posts)
Google, Yahoo and MSN (11 posts)
Hosting (3 posts)
Microsoft (4 posts)
My Ramblings (12 posts)
Resources (6 posts)
Servers (1 posts)
Tech News (26 posts)
Thoughts (1 posts)
Updates (1 posts)
Wordpress (1 posts)