6

In Drupal 7 Poormanscron has been made part of core and is the default. I understand that for this to work at all, the site must get regular page requests in order to trigger Poormanscron - but that is not a concern with my site.

The Javascript it inserts in each page is insignificant and should not deteriorate overall performance much (if anything). However, when the cron task actually runs, it will do so when someone requests a page, which is exactly the time you do not want your site to appear busy. Is this a concern, or is this taken care of in some way (e.g. by running the cron task as a low priority subprocess)?

Poormanscron let you configure frequency, but not when to run. I would prefer to have cron run at night, when the site see very little traffic.

So far, I've made do with Poormanscron. The fact that it comes "built-in" can be viewed as some sort of recommendation. However, I am concerned about performance. To me, it looks as if setting up an external cron job (with Gnu/Linux/Unix crontab) is a better solution for a production site. Is this correct, or is there something I've overlooked? Are there other things one should factor into this comparison?

PS. I already know about the Elysia cron contributed module (basically a poor man's cron on steroids), and that it will let you set the time of day to run. However, to keep this focused I will prefer answers that only look at the core Poormanscron vs. external cron. (Adding contributed modules also carries a performance penalty.)

  • I think there is a lot of great stuff in this question. But I find it really hard to understand what the actual QUESTION here is (there are more then 1 in it I think). I would hate my suggested edit to be rejected by ... the (popular) author of the question (hey there!). And "flagging" it seems not appropriate either. Instead I suggest the author tries to do so, by better pointing out what the actual question (or questions?) are ... – Pierre.Vriens Mar 14 '15 at 7:26
  • @Pierre.Vriens, sorry if you found question unclear. I've changed the title into a direct question to make it clearer. The answer (by Phizes) did at last help me understand how cron impacts performance. I no longer use Poormanscron on production sites. – Free Radical Mar 14 '15 at 16:18
  • NOW we are cooking! By only reading the title of the question you already have an elevator pitch. So now one can already predict a bit what the details provided in the question are going to be about. Even without "clicking" on the question if (eg) its title (only) shows up in the "related" column to the right. As a sample, right now I see a question titled "Cron not working" to the right of where I'm typing ... as compared to "How to limit drupal cron CPU usage". Which "title" is more attractive? BUT: I have multiple rejected edits today because ... I only rephrased the question ... Grrrrrrrr! – Pierre.Vriens Mar 14 '15 at 16:29
8

Unless I'm mistaken. Poormans cron significantly impacts page load performance when cron runs. I only use it on sites I'm quickly working with locally and have no intention of working on in the near future again.

Using crontab to run cron completely removes the detrimental performance of using poormans cron, apart from the subsequent page load having to re-build the necessary caches. Using crontab is the better option, it provides predictable behaviour, is more reliable, and has less of an effect on users.

You may also want to look into using drush to run cron.

As a side note, on the performance tab there is a setting for the 'Minimum cache lifetime' does not only affect the page cache but all caches. If a time is not set there then as far as I know all caches are dumped on each cron run. (There are one or two sensationalist blog posts which appear to say otherwise though, but if you look at the core code they are incorrect.) This is something else which comes into play with cron runs and performance.

Elysia cron: This is more cron on steroids, and is not a replacement for poormans cron, as the Elysia cron documentation suggests, you should have cron running every minute to get the most flexibility with it, which poormans cron is just not capable of.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.