Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17311

Expand and encourage use of hash syntax in crontabs

XMLWordPrintable

      Jenkins supports H in crontab specification to balance load across different times of day in a predictable yet natural way, so you do not get sudden spikes of activity. Special syntaxes like @daily use this automatically. And you can use it explicitly in five-field specs for more control.

      Yet the H syntax is not widely used, and it is not powerful enough to handle e.g. jobs which should be triggered every quarter hour. The result is terrible performance on large installations where a lot of people innocently configure triggers that all go off at once.

      Suggested changes:

      1. Expand the syntax to support e.g. H/15 * * * * for a trigger to run every fifteen minutes according to hash (e.g. 3, 18, 33, and 48 minutes past the hour).
      2. Update inline help to advocate hash syntax as the normal usage, and warn that misuse of exact times can overload the system.
      3. Provide form validation that flags use of exact times as a warning and suggests the hash syntax to use instead.
      4. Supply a standalone utility function which may be run to make that transformation in bulk across a bunch of job configs.

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: