JobConfigHistory Plugin Best Practices

Issue

Environment

Resolution

JobConfigHistory Plugin is a plugin designed to maintain the history of what has changed in the Jenkins job configuration and the system configuration. When a save operation is performed in Jenkins, then the history of what was changed (diff) and who made the changes (user) is saved. It could be a manual save from the UI or a programmatic save.

Recommended configuration

There are many customization possibilities to improve the performance of the JobConfigHistory Plugin that are going to impact positively in the overall instance performance.

The configuration can be edited at Manage Jenkins -> Configure System -> Job Config History:

Configure System / JobConfigHistory

  • Use different history directory than default - Setting this option to a new location is good if you would like to store the job configuration history in another location other than $JENKINS_HOME/config-history (like another mount or another drive). We strongly encourage users to set this to another mount/drive as the job config history plugin will increase the number of inodes for the JENKINS_HOME directory.
  • Max number of history entries to keep - We recommend keeping this number to a minimum (about 1000). If left blank then all entries will be kept.
  • Max number of days to keep history entries - We recommend the max number of days to be 30 days.
  • Max number of history entries to show per page - (For Job Config History version 2.18 or later) We recommend keeping this number to a minimum (about 20). This control the number of history records being loaded when browsing the config history of a job.
  • System configuration exclude file pattern (default: queue\.xml|nodeMonitors\.xml|UpdateCenter\.xml|global-build-stats) - If there is configuration in the System configuration page which is altered too often or if altering it does not impact users, then those options can be excluded from being added to the exclude file pattern. Please, keep the default configuration, adding more patterns if required. For example, queue\.xml|nodeMonitors\.xml|UpdateCenter\.xml|global-build-stats|OperationsCenterCredentialsProvider|LockableResourcesManager\.xml|MilestoneStep\.xml
  • Do not save duplicate history - We recommend disabling this option. This option removes duplicate entries or entries where nothing changes but is also the cause of performance issues.
  • Save Maven module configuration changes - We recommend disabling this option. When a maven project completes the job configuration is saved, which causes an increase in the amount of maven module configuration changes.
  • Show build badges - in order to not overload the history widget.
  • Exclude users - if you want to exclude changes by a specific user. For example, excluding SYSTEM in a CJP OC - CJP CM configuration.
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Subhabrata Sarkar

    This was very useful for me, thanks

  • 1
    Avatar
    Judah Greenblatt

    Proofreading:

    "Show build badges": the recommended setting is missing - from context I think this should be "Never".

    "Do not save duplicate history" list item seems to be garbled.  You want to DISABLE the option to NOT SAVE duplicates???????  I think you want this entry to be enabled.

    "Max number of history entries to keep":  Reading the code shows that the number of entries is applied per config file (job, node, or global configuration file).  1000 seems excessive for history entries for a single file/node/job.  I would think that 20-100 would be more reasonable.

    "Max number of days to keep history entries": There seems to be a bug in this plugin where this setting is applied to jobs at the top-level only - it is not applied to jobs inside folders.  I'm trying to file a bug against the plugin to get this fixed.

Please sign in to leave a comment.