TFS slow response when doing version control operations

(Chinese Version)

Symptom:

================

I’ve meet some cases where TFS version control operations can be quite slow when the TFS deployment is based on a virtual machine like VMWare or Hyper-V. Problem inludes

  • When performing large updates to TFS, such as undo pending changes/label/checkin multiple items, user may experience slow server response up to several minutes. Sometimes user even receive timeout error.
  • When the problem happens, people can observe  CXPACKET and PAGEIOLATCH_SH Wait Types in SQL Server, along with high average disk queue length and high %Disk Wait in the operating system.
  • The TFS application tier server application event log containe a lot of SQL “timeout expired” exceptions.

Root cause & solution:

==================

A common root cause is SQL Server slow disk I/O on a virtual machine. It can be solved by improving the virtual machine disk I/O speed, moving the SQL Server instance to dedicated box , or even moving the SQL Server instance to a physical box.

More information:

=================

One can configure TFS SQL Server command timeout value on the application tier server, in file %program files%/Microsoft visual studio {version} team foundation server/web services/web.config , SQLTimeOut value; and configure TFS SQL Server connection timeout value on the application tier server, in file %program files%/Microsoft visual studio {version} team foundation server/web services/services/web.config , the database connection string. 

Enlarging the default value does not boost the performance, yet can prevent the timeout error from happening.

Documents:

===================

1. Performance considerations about TFS on a virtual machine

https://blogs.msdn.com/bharry/archive/2008/06/27/tfs-on-hyper-v.aspx

https://blogs.msdn.com/charles_sterling/archive/2006/11/22/how-to-boost-tfs-performance-under-a-vm-by-dugie.aspx and

https://msdn.microsoft.com/en-us/library/dd904316.aspx

2. TFS hardware requirement recommendation

https://msdn.microsoft.com/en-us/library/ms400687(VS.80).aspx