{"id":1913,"date":"2007-09-17T22:04:47","date_gmt":"2007-09-17T22:04:47","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/buckh\/2007\/09\/17\/tfs-2008-controlling-the-number-of-threads-used-in-uploading-and-downloading-files\/"},"modified":"2007-09-17T22:04:47","modified_gmt":"2007-09-17T22:04:47","slug":"tfs-2008-controlling-the-number-of-threads-used-in-uploading-and-downloading-files","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/buckh\/tfs-2008-controlling-the-number-of-threads-used-in-uploading-and-downloading-files\/","title":{"rendered":"TFS 2008: Controlling the number of threads used in uploading and downloading files"},"content":{"rendered":"<p>The TFS version control client object model normally uses up to eight threads from the thread pool to upload or download files.&nbsp; This same mechanism is also used in pending adds: Files are opened to determine whether they are binary or text, so batches are sent to the server while other batches are being examined on disk.&nbsp; It also uses eight threads.<\/p>\n<p>Some customers have encountered a problem where a firewall will consider these multiple simultaneous connections to the server to be suspicious activity and block them (e.g., interpret them as a DOS attack).&nbsp; In TFS 2005 there was no way to control this.<\/p>\n<p>In TFS 2008 (beta 2 and newer), we added a way to control how many threads are used.&nbsp; You can control how many threads are used by changing the .config file (tf.exe.config, devenv.exe.config, or your own app&#8217;s .config, depending on what you are running) and set VersionControl.MaxBackgroundThreads to the number you desire from 0 to 64 (defaults to 8).<\/p>\n<p>For example, the following will restrict it to two threads.<\/p>\n<blockquote><p> &nbsp;&nbsp; &lt;appSettings&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add key=&#8221;VersionControl.MaxBackgroundThreads&#8221; value=&#8221;2&#8243; \/&gt;<br>&nbsp;&nbsp; &lt;\/appSettings&gt;<\/p>\n<\/blockquote>\n<p>If you set the maximum number of background threads to zero, the request is made on the calling thread rather than a thread from the thread pool. <\/p>\n<p>Some customers have reported that they have solved the problem by having the TFS client bypass the network proxy for local (intranet) addresses.&nbsp; You can do this by changing the settings in IE to bypass the network proxy for local addresses.&nbsp; Alternatively, you can change this just for TFS by setting the following registry value.&nbsp; You can set the following in either HKLM (global for the computer) or HKCU (for a particular user on the computer).&nbsp; Change 9.0 to 8.0 if you are using TFS 2005 rather than TFS 2008. <\/p>\n<blockquote><p> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\TeamFoundation\\RequestSettings] <\/p>\n<p>&#8220;BypassProxyOnLocal&#8221;=&#8221;true&#8221;<\/p>\n<\/blockquote>\n<p><div class=\"wlWriterSmartContent\" id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:eb97c298-a92c-4141-9da6-924602cf6bbb\" style=\"padding-right: 0px;padding-left: 0px;padding-bottom: 0px;margin: 0px;padding-top: 0px\">Technorati tags: <a href=\"http:\/\/technorati.com\/tags\/tfs%202008\" rel=\"tag\">tfs 2008<\/a>, <a href=\"http:\/\/technorati.com\/tags\/team%20foundation\" rel=\"tag\">team foundation<\/a>, <a href=\"http:\/\/technorati.com\/tags\/source%20control\" rel=\"tag\">source control<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The TFS version control client object model normally uses up to eight threads from the thread pool to upload or download files.&nbsp; This same mechanism is also used in pending adds: Files are opened to determine whether they are binary or text, so batches are sent to the server while other batches are being examined [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":10268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[6,8],"class_list":["post-1913","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-source-control","tag-team-foundation"],"acf":[],"blog_post_summary":"<p>The TFS version control client object model normally uses up to eight threads from the thread pool to upload or download files.&nbsp; This same mechanism is also used in pending adds: Files are opened to determine whether they are binary or text, so batches are sent to the server while other batches are being examined [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/1913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/comments?post=1913"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/1913\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media\/10268"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media?parent=1913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/categories?post=1913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/tags?post=1913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}