TFS2012: What are all the different Jobs built-in to TFS?

Grant Holliday’s blog

Senior Service Engineer, Microsoft Visual Studio Team Foundation Service

TFS2012: What are all the different Jobs built-in to TFS?

Rate This
  • Comments 5

This is a question that I get occasionally, and it’s covered in more detail in the Professional Team Foundation Server 2012 book that I wrote.

Team Foundation Server has a Job Agent built in. It’s implemented as a Windows Service that runs on your Application Tier servers. There are some tables and stored procedures in the Tfs_Configuration database and your collection databases that define the jobs, the job queue and the job history. You can read more about the internals of the TFS Background Job Agent in Chris Sidi’s blog post, including how to control it using the TFS API and PowerShell.

The following table describes all of the jobs across the configuration and collection databases and their default schedule:

Job Name

Scheduled Interval

Build Cleanup Job

 

Build Information Cleanup Job

2 days

Build Warehouse Sync

30 minutes

Cleanup Discussion Database

daily

Cleanup TestManagement Database

daily

Common Structures Warehouse Sync

30 minutes

File Container Cleanup

daily

Job History Cleanup Job

2 days

Message Queue Cleanup Job

2 days

Optimize Databases

7 days (collection)
1 day (configuration)

Prune Registry Audit Log

7 days

Repopulate Dynamic Suites

hourly

Security Identity Cleanup Job

daily

Synchronize Test Cases

10 minutes

Team Foundation Server Activity Logging Administration

2 days

Team Foundation Server Coverage Analysis

hourly

Team Foundation Server Event Processing

daily

Team Foundation Server Framework Data Cleanup

daily

Team Foundation Server Framework File Service Cleanup

daily

Team Foundation Server Send Mail Job

daily

Test Management Warehouse Sync

30 minutes

Upgrade - Version Control Code Churn Online

 

Version Control Administration

5 days

Version Control Code Churn

daily

Version Control Delta Processing

daily

Version Control Statistics Update

daily

Version Control Warehouse Sync

30 minutes

Work Item Tracking Administration

daily

Work Item Tracking Integration Synchronization

hourly

Work Item Tracking Referenced Identities Update

7 days

Work Item Tracking Remove Orphan Attachments

daily

Work Item Tracking Remove unused constants

14 days

Work Item Tracking Warehouse Sync

30 minutes

The ones that I often get questions about are the following:

  • Optimize Databases – This will reorganize/rebuild any indexes in SQL that exceed the fragmentation threshold
  • TFS Activity Log Administration – This will purge data in the activity log (tbl_Command) that is older than 14 days
  • Version Control Code Churn Online – This is a once-off job that runs after upgrade from TFS2010 to TFS2012. The format for storing the code churn data changed, so rather than converting that data during upgrade, it was done slowly over time post-upgrade by this job.

Update: Thanks for the comment Tommy - I forgot a very important aspect of some of these jobs. Although the default schedules are listed above, some of them are queued 'on demand' by events that happen in TFS. Two examples of this are:

  • Team Foundation Server Event Processing - This job is responsible for sending out email alert subscriptions and SOAP alert subscriptions. For example, when a work item is changed - this job is queued on demand to process any alerts.
  • The various Warehouse Sync jobs - These jobs are also triggered to run when data changes as well. By default, they don't run more often than every 5 minutes.

Another concept which you might come across is 'Host Dormancy'. This is a feature built-in to the 'kernel' of TFS that will pause jobs from running if a collection hasn't been accessed in a period of time. If a collection isn't being accessed, that means that the data isn't changing, so there's no need to run some jobs. This is key functionality that allows the Team Foundation Service to scale to thousands of collections.

  • How about the more frequent jobs?

    If I'm not mistaken there is a job that checks if emails should be sent that runs every 2 minutes, and a job that runs every 5 minutes to update the Warehouse from the TPC databases?

    It's a great list btw, I just want to clear up possible confusion on my side.

    Thanks!

  • @Tommy - I updated the post with an answer to your question. Hope that clears up the confusion.

  • Any chance of getting descriptions for what each of these jobs do, specifically "Work Item Tracking Integration Synchronization"?

  • @Computerpaul - Most of them are self-explanatory. Were there any in particular you wanted to know about?

    Page 692 of the book I wrote describes some of the important ones. Grab yourself a copy at http://bit.ly/ProTFS2012

  • @Grant Holliday - I was specifically looking for the "Work Item Tracking Integration Synchronization" job

Page 1 of 1 (5 items)