Hi PerlMonks,

I have build a Perl SNMP collector to collect various performance data from a group of (76) storage devices and store them in Graphite Carbon. Due to requirements, I need to collect that information for each 10 seconds.

As "cron" on the system we are using does not support seconds, I decided a scheduler / cron like module in Perl itself and decided to use Schedule::Cron module.

Made some small tests to see its behavior and was happy. Then start to use it in real life.

But the issue is, it misses some entries in crontab I created in the script. As you can see below, I intend to run following crontab entries againts 76 devices at specified intervals...

$cron->add_entry("* * * * * 0-50/10", \&subroutine_name_0, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 1-51/10", \&subroutine_name_1, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 2-52/10", \&subroutine_name_2, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 3-53/10", \&subroutine_name_3, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 4-54/10", \&subroutine_name_4, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 5-55/10", \&subroutine_name_5, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 6-56/10", \&subroutine_name_6, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 7-57/10", \&subroutine_name_7, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +; $cron->add_entry("* * * * * 8-58/10", \&subroutine_name_8, $param1, $p +aram2, $param3, $param4, $param5, $param6, $param7, $param8, $param9) +;

What I see in logs is that it runs for a while in order (at specified intervals) then starts to shift or delay running. Below is a piece of output from log file for 8. crontab entry above

Sun Jun 29 17:16:17 2014 Sun Jun 29 17:16:27 2014 Sun Jun 29 17:16:37 2014 Sun Jun 29 17:16:47 2014 Sun Jun 29 17:16:57 2014 Sun Jun 29 17:17:07 2014 Sun Jun 29 17:17:20 2014 Sun Jun 29 17:17:59 2014 Sun Jun 29 17:18:41 2014 Sun Jun 29 17:19:28 2014 Sun Jun 29 17:20:14 2014 Sun Jun 29 17:21:00 2014 Sun Jun 29 17:21:46 2014 Sun Jun 29 17:22:25 2014 Sun Jun 29 17:23:11 2014 Sun Jun 29 17:23:59 2014 Sun Jun 29 17:24:44 2014 Sun Jun 29 17:25:33 2014 Sun Jun 29 17:26:14 2014 Sun Jun 29 17:26:48 2014 Sun Jun 29 17:27:32 2014 Sun Jun 29 17:28:16 2014 Sun Jun 29 17:29:03 2014 Sun Jun 29 17:29:54 2014 Sun Jun 29 17:30:40 2014 Sun Jun 29 17:31:32 2014 Sun Jun 29 17:32:12 2014 Sun Jun 29 17:32:57 2014 Sun Jun 29 17:33:45 2014 Sun Jun 29 17:34:30 2014 Sun Jun 29 17:35:15 2014 Sun Jun 29 17:35:51 2014 Sun Jun 29 17:36:42 2014 Sun Jun 29 17:37:18 2014

So my questions are:

- Anybody had such an experience with Schedule::Cron module?

- Can anybody suggest alternative to Schedule::Cron which you use and have good experiences with it?

Any help is appreciated. Thanks in advance and kind regards.

-Suleyman Kutlu


In reply to Schedule::Cron module misses to run crontab entries sometimes by snk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.