Closed (fixed)
Project:
Ultimate Cron
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2012 at 00:00 UTC
Updated:
20 Jul 2014 at 12:29 UTC
Jump to comment: Most recent
Comments
Comment #1
dropbydrop commentedThere is a discussion between the developers of the modules at Collaboration and Drupal 8, but it is more about a developer's point of view.
From a site builder's point of view:
- What is the difference in the features?
- What is the difference in performance? As I understand they are both parallel executing jobs?
- Do they need a cron job set at linux, otherwise if we don't have visitors how they run?
Comment #2
gielfeldt commentedIt's been quite awhile since I looked at Elysia Cron in detail, but the main difference is probably (listing Ultimate Cron features):
* True parallelization of jobs (including queues) vs serial processing of "channels"
* Load balancing in multiple server setup
* Aims to work out-of-the box for all features and everything configurable from within Drupal, with no need for server sysadm know-how (well except for the cron syntax).
* Extensible (hook_cron_alter(), hook_cron_schedule_alter(), etc.)
* Multiple rules per job (if you need a special rule, that cannot be expressed through one cron syntax)
* Self-healing capabilites for stalled jobs.
* Controlling/throttling of queue processing through Ultimate Cron Queue Scaler (dev).
* (Re)serializing jobs if needed through Ultimate Cron Serializer (dev).
Note: warning may be biased, as the differences mentioning above were the features I lacked in Elysia Cron.
Now for the main similarity:
I actually started out by using Elysia Cron for the project that I created the original Ultimate Cron module for. However it didn't fit my needs, and when attempting to add what I neeeded, I ended up doing such as big rewrite, that it warranted a new module, also taking in to account that the goals of the Elysia and Ultimate are different. This also means that being inspired greatly by Elysia Cron, 3rd party modules using hook_cronapi() for Elysia Cron should be possible to use with Ultimate Cron. I'm currently trying to work out with the maintainer of a common cronapi() format and perhaps propose this for Drupal 8.
Comment #3
dropbydrop commentedThanks a lot for your answer.
So, ultimate cron has much more features.
I wish you could publish a more recent stable version of ultimate cron.
Another question:
What happens if a site has rarely visitors? Should I setup cron job in linux?
Comment #4
gielfeldt commentedYes, a new release should be made soon. I'm was currently working on it, but put on hold due to lack of time. I'll see if I can get it done real soon.
I would always recommend setting up a cron in linux instead of using poorman's cron, if this is possible, as this is more stable. However, there are some improvements in Ultimate Cron's poorman's cron over the core one. It launches the cron scheduler in a background process, which keeps itself alive, so you just need one page visit to trigger it, and then cron is running. The other benefit of launching the scheduler in a background process, is that it cron runs don't take up the end users time.
This poorman's cron process can die of course, in cases of server restarts, broken code during updates, etc., and then you need another page visit to relaunch it. So it's a judgement call I guess, depending on how rarely "rarely" is.
Comment #5
dropbydrop commentedSo, does ultimate cron work only if there is a visitor?
There are sites that have a visit once per few days, but there must be module security update checks every day.
In this case, I'll setup an external cron job at linux.
But, is there a way to disable poormancron approach at ultimate cron?
Also, after installing UC modules, does running cron manually go through UC so to run in parallel (and other benefits)?
thanks
Comment #6
gielfeldt commentedWhen running in poorman's cron mode, Ultimate Cron works only if a visitor has triggered the cron. Just like Drupal without Ultimate Cron. However, it's should be necessary to repeatedly visit the page to launch cron, like it is in a regular Drupal setup, because the poorman's cron from Ultimate Cron is a background driven process.
If setting up a linux crontab (e.g. wget * * * * * http://example.com/cron.php) you can disable the poorman's cron. There's a checkbox for this on the Ultimate Cron settings page.
In most cases, Ultimate Cron will work out-of-the box using the poorman's cron method, even if no linux crontab has been setup.
As of D7 the poorman's cron is the default way to run cron, why this is enabled upon installation of Ultimate Cron.
And yes, Ultimate Cron bypasses the regular cron and parallelizes everything.
Comment #7
dropbydrop commented1.So a wget ...cron.php...will pass through Ultimate Cron, right?
2. "However, it's should be necessary to repeatedly visit the page to launch cron, like it is in a regular Drupal setup" where is documented that regular drupal cron needs repeated visits to launch cron?
3. Since you write "however" did you mean to write that for ultimate cron it should NOT need repeated visits?
Thanks for your support
Comment #8
gielfeldt commented1.) Yes. Remember to use "* * * * *" (every minute), as Ultimate Cron now handles the scheduling per job. If it is not possible to configure the crontab for every minute, I would suggest using poorman (or just use both to be sure, they do not interfere with each other).
2.) Set up cron. If no crontab on the server is set up, Drupal needs a user to visit a page for cron to run. More info on the concept of Poorman's cron can be found here
3.) Yes :-), "it's should" => "it shouldn't".
Comment #9
dropbydrop commentedDo you mean that even if I put cron job every minute, each task will be executed according to the settings of ultimate cron? cool
Comment #10
gielfeldt commentedYup. That's the goal of Ultimate Cron. Configure everything from within Drupal.
Comment #11
dropbydrop commentedSo, if I put system cron every minute, and then I disperse the execution of jobs so that they don't happen on the same time, do you think that would be ok for shared hosting?
thanks
Comment #12
gielfeldt commentedYes, I think this would be ok. Also in the dev version of Ultimate Cron there's an extension to the cron syntax, and the default rule is "*/10+@ * * * *" where @ is a system generated offset, meaning that all jobs will run every ten minutes but not at the same minute. If you want to just run all jobs each hour, you can use the rule "@ * * * *".
Comment #13
dropbydrop commentedQuestions and answers here are useful for a FAQ section.
Thanks
Comment #14
k_ commentedI've installed both elysia_cron and ultimate_cron for comparison.
case 1)
elysia_cron - enabled
ultimate_cron - disabled
using external exec of cron.php,
works as expected.
case 2)
same server,
elysia_cron - disabled
ultimate_cron - enabled
using external exec of cron.php,
What's different about ultimate_cron's access requirements?
Comment #15
k_ commentedComment #16
gielfeldt commentedYou seem to be missing the cron key in the Ultimate Cron use case. Ultimate Cron does not implement any access checks that could produce a 403 when accessing cron.php. However, if accessing cron.php without a cron key (or an incorrect cron key) or if your site is in maintenance mode, you will get a 403.
Comment #17
k_ commentedThanks, my mistake.
With elysia_cron, I see the cron_key field in the module Settings page.
With ultimate_cron, I do not - & mistakenly assumed it's not supported. So didn't use it.
Noting that is IT referenced/defined @ admin/reports/status, I (re)add the cron_key to the wget string, and it works.
Although I have the same 'doesn't update the status page' issue as I'd reported here: https://drupal.org/node/1675970.
Which makes me suspect it's NOT (just?) an elysia_ or ultimate_ issue.
Comment #18
gielfeldt commentedI don't know why Elysia Cron has the cron key on it's settings page. Perhaps in order to be able to change it? I could add that though. Sounds like a could-be-useful feature.
About the status for cron's last run. The status DOES update on my setup. Looking at Ultimate Cron's code, I can see no reason why it shouldn't get updated? I currently have no theories to why you are experiencing this :-(. However with Elysia Cron, I could imagine you would experience this from time to time, as the variable is updated directly in the database, and the cache isn't maintained. Ultimate Cron also updates the db directly in order to prevent too many invalidations to the variables cache, but the cache is effectively bypassed for that particular variable when it's read.
Comment #19
k_ commented> Perhaps in order to be able to change it?
It's changeable
> could-be-useful feature.
Nice, not critical.
> About the status for cron's last run. The status DOES update on my setup. Looking at Ultimate Cron's code, I can see no reason why it shouldn't get updated?
Hm. Some more info ... drush works ...
for reference,
@ admin/reports/status
Cron maintenance tasks Last run 1 hour 51 min agoThen
still not updated @ admin/reports/status
Cron maintenance tasks Last run 1 hour 52 min agobut with drush
it's updated, @ admin/reports/status
Cron maintenance tasks Last run 30 sec agoI'm not clear if that drush cron exec is 'going through' ultimate_cron's task management/parallelization ... ?
Comment #20
gielfeldt commentedWhen using "drush cron", Ultimate Cron is not invoked but only Drupal's regular cron is used, which could explain why the timestamp is properly updated.
I'm still not sure why it doesn't work for you when using wget. When ultimate cron runs, it updates the timestamp directly in the database. To bypass the cache, it loads the value from the db during hook_init() and stores it in the global $conf variable.
Could you check the value of "cron_last" directly in the db, immediately after you've run cron through wget?
Comment #21
k_ commented> Could you check the value of "cron_last" directly in the db, immediately after you've run cron through wget?
Comment #22
gielfeldt commentedHmmm. Do you get any watchdog messages from ultimate_cron?
Comment #23
k_ commented@ wget ...
Comment #24
gielfeldt commentedWhat about drupal's watchdog system (admin/reports/dblog)
Comment #25
k_ commented> What about drupal's watchdog system (admin/reports/dblog)
Enabling the dblog module helps.
> wget ...
@ admin/reports/dblog
clicking on the message link,
Comment #26
gielfeldt commentedAh. Could you try enabling the "Database logging" module? Then try out the cron, and revisit the admin/reports/dblog page afterwards.
Comment #27
k_ commented> Could you try enabling the "Database logging" module?
It already *is* enabled:
The result, above, at comment #25, is with the module enabled.
Comment #28
gielfeldt commentedSorry, didn't see your last message.
Could you try "drush cron-run all" and see if this updates the timestamp?
Comment #29
k_ commentednp.
yes, it does,
and at the status page
Cron maintenance tasks Last run 5 sec agoComment #30
gielfeldt commentedHmm... Perhaps an odd question: If you disable both Elysia Cron and Ultimate Cron, then does the timestamp update if you do a wget?
Comment #31
k_ commentedfailed to identify the source of the problem, but cured it.
disabling & uninstalling, then re-dl'ing+reenabling ultimate_cron made no difference.
clearing caches did nothing.
but disabling & uninstalling, then phsyically rm'ing the module directory, clearing all caches, and re-installing a completely clean/new instance of ultimate_cron seems to have fixed the problem. No other changes made.
@ wget ..., the StatusReport page now shows:
Cron maintenance tasks Last run 2 sec agorefreshed once per minute.
To try to track down the problem, I reverted to a git revision of my module tree prior to this step -- and the problem is also/still gone. I can't get it to return/repeat.
Frustrating as this makes no sense to me, and there's no sign of what the problem was. I'll keep an eye out for any return of the problem.
Comment #32
gielfeldt commentedIt makes no sense to me either :-). Glad you got it to work though.
If the problem returns, please open another ticket so we won't spam previous followers of this ticket.
Comment #33
gielfeldt commentedComment #34
pere orgaHi,
Please could you put the list of main differences (not only Ultimate Cron features) in the module front page? It would help users to choose the right module, especially if -as you say- the two modules have different goals.
I plan to study the two modules in detail so I would like to help on this
Comment #35
gielfeldt commentedHi
I'm not really sure if this information is best suited on the project page. It depends on how verbose it will be. Also, I'm not sure of the differences in detail between Elysia Cron and Ultimate Cron anymore. We did try to initiate a join-forces project once, but that didn't go anywhere.
"Different goals" may have been a stretch. Both modules enhance the cron functionality in Drupal, but in their own ways, which are not always compatible (hook_cronapi definition for example). As a result they may provide different features that may appeal to different users. What i can say, is that one of the goals of Ultimate Cron is to control everything from within Drupal, without having the need to setup server crontabs etc., yet still providing this feature.
If you get an overview of the differences between the two modules, I would be happy to add it to the project page and/or documentation.
Comment #36
pere orgaCool thanks, I'll look into it
Comment #37
gielfeldt commented