{"id":5691,"date":"2013-10-25T17:24:05","date_gmt":"2013-10-25T15:24:05","guid":{"rendered":"https:\/\/ingmarverheij.com\/?p=5691"},"modified":"2014-04-09T20:48:14","modified_gmt":"2014-04-09T18:48:14","slug":"microsoft-app-v-5-0-streaming-via-http","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/microsoft-app-v-5-0-streaming-via-http\/","title":{"rendered":"Microsoft App-V 5.0 &#8211; Streaming via HTTP"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"border: 0px currentColor; padding-top: 0px; padding-right: 0px; padding-left: 0px; float: right; display: inline; background-image: none;\" title=\"Microsoft App-V 5.0\" alt=\"Microsoft App-V 5.0\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Microsoft-App-V-5.01.png\" width=\"78\" height=\"75\" align=\"right\" border=\"0\" \/>With Microsoft App-V 5.0 virtual application packages (or sequences) can be streamed to the client with two delivery methods: SMB or HTTP. With SMB being the easiest one (all you need is a file share), the HTTP delivery mechanism is IMO more scalable.<\/p>\n<p>The ability to stream via HTTP is natively built-in in the App-V client, no configuration is required. All that is needed to publish the application via HTTP is to specify the URL instead of the UNC location at the Management Server. Unfortunately Microsoft doesn\u2019t provide us with a description on how to built a <a href=\"https:\/\/technet.microsoft.com\/nl-nl\/library\/cc753433(v=ws.10).aspx\" target=\"_blank\">Microsoft IIS Web Server<\/a> to enable it to stream App-V packages.<\/p>\n<p><!--more--><\/p>\n<h1>\u00a0<\/h1>\n<h1>MIME type<\/h1>\n<p>The first (and most simple) thing you need to configure is to add the file extension <strong>.appv <\/strong>as a MIME type. You can achieve this by following these steps:<\/p>\n<ol>\n<li>Open the <strong>Internet Information Services (IIS) Manager<\/strong><\/li>\n<li>Select the <strong>(Default) Web Site <\/strong>(the site where you\u2019re publishing the content)<\/li>\n<li>Click on <strong>IIS \\ MIME Types<\/strong><\/li>\n<li>Click on <strong>Add<\/strong>\n<ul>\n<li>File name extension: .appv<\/li>\n<li>MIME type: application\/appv<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Internet-Information-Services-IIS-Manager1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Internet Information Services (IIS) Manager\" alt=\"Internet Information Services (IIS) Manager\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Internet-Information-Services-IIS-Manager_thumb1.png\" width=\"254\" height=\"179\" border=\"0\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Edit-MIME-Type1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Edit MIME Type\" alt=\"Edit MIME Type\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Edit-MIME-Type_thumb1.png\" width=\"254\" height=\"149\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>Virtual directory<\/h1>\n<p>Next you might want to create a virtual directory that points to a folder shared on the network containing your virtual application packages. These are again a number of easy steps:<\/p>\n<ol>\n<li>Open the <strong>Internet Information Services (IIS) Manager<\/strong><\/li>\n<li>Right-click on the <strong>(Default) Web Site <\/strong>(the site where you\u2019re publishing the content) and click on <strong>Add Virtual Directory<\/strong><\/li>\n<li>Specify an Alias and the physical path to the share<\/li>\n<li>Click on <strong>Connect as<\/strong> and specify the credentials to connect to the network share (or you can choose to enable anyonymous authentication) <!--EndFragment--><\/li>\n<\/ol>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Add-Virtual-Directory1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Add Virtual Directory\" alt=\"Add Virtual Directory\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Add-Virtual-Directory_thumb1.png\" width=\"254\" height=\"207\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>Caching<\/h1>\n<p>Like I wrote in the beginning of the article using a webserver to stream virtual application packages to clients is more scalable. The reason for this is that the webserver can cache files in memory, relieving the fileserver. Especially when you\u2019ve got thousands of clients you don\u2019t want them all to connect directly to the fileserver but spread them across a number of webservers using a load balancer.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Microsoft-App-V-5-streaming-via-HTTP.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;\" title=\"Microsoft App-V 5 streaming via HTTP\" alt=\"Microsoft App-V 5 streaming via HTTP\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Microsoft-App-V-5-streaming-via-HTTP_thumb.png\" width=\"354\" height=\"408\" border=\"0\" \/><\/a><\/p>\n<h4>\u00a0<\/h4>\n<h4>\u00a0<\/h4>\n<h4>Web Service Cache<\/h4>\n<p>Microsoft IIS has a number of built-in caching mechanisms to accelerate the delivery of web content which can be monitored with the <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc749249.aspx\" target=\"_blank\">Performance Monitor<\/a>. All related information is collected in counter category <strong>Web Service Cache<\/strong>. While you might expect this works out of the box, it doesn\u2019t (well it does but only for very tiny applications).<\/p>\n<p>&nbsp;<\/p>\n<h6>File Cache Memory Usage<\/h6>\n<p>After downloading an App-V package (of 250Mb) twice using a browser the <strong>File Cache Memory Usage<\/strong> is still 0 (and <strong>File Cache Misses <\/strong>is 2). As a result the virtual application file is retrieved from the file server for each client, making the webserver no more than a proxy (kinda useless right?).<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Web-Service-Cache-Default.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Web Service Cache - Default\" alt=\"Web Service Cache - Default\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Web-Service-Cache-Default_thumb.png\" width=\"254\" height=\"73\" border=\"0\" \/><\/a><\/p>\n<p>As a result both the <strong>send<\/strong> and <strong>received<\/strong> usage of the Ethernet adapter is ~100 Mbps.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Ethernet-usage-Default.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Ethernet usage - Default\" alt=\"Ethernet usage - Default\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Ethernet-usage-Default_thumb.png\" width=\"254\" height=\"231\" border=\"0\" \/><\/a><\/p>\n<h6>.<\/h6>\n<h6>\u00a0<\/h6>\n<h6>Tuning<\/h6>\n<p>The reason for this is that the maximum size of a cached object is 256 KB. So unless your App-V package is 1\/4 MB, it\u2019s not cached. Fortunately this can be changed using the registry key:<\/p>\n<p><strong>HKLM\\System\\CurrentControlSet\\Services\\InetInfo\\Parameters\\MaxCachedFileSizeInMB (REG_DWORD) <\/strong><\/p>\n<p>I\u2019ve changed this value to <strong>4096 (4GB)<\/strong> so IIS will cache all files smaller then 4GB. IIS manages the available memory and will a <strong>scavenger <\/strong>each <strong>120 seconds<\/strong>. If you want to keep your files caches longer then 2 minutes you can increase the ObjectCacheTTL value to a higher number.<\/p>\n<p><strong>HKLM\\System\\CurrentControlSet\\Services\\InetInfo\\Parameters\\ObjectCacheTTL (REG_DWORD) <\/strong><\/p>\n<p>I\u2019ve changed this value to 600 seconds so App-V clients get the virtual application package from the memory of the webserver instead fileserver if it\u2019s downloaded within 10 minutes.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/MaxCachedFileSizeInMB.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"MaxCachedFileSizeInMB\" alt=\"MaxCachedFileSizeInMB\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/MaxCachedFileSizeInMB_thumb.png\" width=\"254\" height=\"155\" border=\"0\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/ObjectCacheTTL.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"ObjectCacheTTL\" alt=\"ObjectCacheTTL\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/ObjectCacheTTL_thumb.png\" width=\"254\" height=\"154\" border=\"0\" \/><\/a><\/p>\n<p>IIS\u00a0 uses an algorithm to determine if files should be cached, by default IIS only caches files that are requested <strong>twice <\/strong>within <strong>ten<\/strong> seconds. As with the MaxCachedFileSizeInMB parameter this makes sense for websites, but not when caching virtual application packages. The following two parameters can be configured in the <strong>&lt;serverRuntime&gt;<\/strong> section of the file <strong>%windir%\\system32\\inetsrv\\config\\applicationHost.config <\/strong>(see <a href=\"https:\/\/www.iis.net\/configreference\/system.webserver\/serverruntime\" target=\"_blank\">Microsoft<\/a>)<\/p>\n<ul>\n<li><strong>frequentHitThreshold<\/strong>: How many times should the same file be requested, before it&#8217;s cached<\/li>\n<li><strong>frequentHitTimePeriod<\/strong>: Time interval in which the same file should be requested {frequentHitThreshold} times, in order to be cached.<\/li>\n<\/ul>\n<p>I\u2019ve replaced the default value in <strong>applicationHost.config <\/strong><\/p>\n<pre>&lt;serverRuntime \/&gt;<\/pre>\n<p>with<\/p>\n<pre>&lt;serverRuntime frequentHitTimePeriod=\"00:00:01\" frequentHitThreshold=\"1\" \/&gt;<\/pre>\n<p>As a result files are cached when it is downloaded <strong>once<\/strong> within a time period of <strong>one second<\/strong>, effectively <strong>always.<\/strong><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/applicationHost.config.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"applicationHost.config\" alt=\"applicationHost.config\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/applicationHost.config_thumb.png\" width=\"254\" height=\"143\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>After changing the values you need to <strong>restart <\/strong>Microsoft IIS service (by executing <strong>iisreset<\/strong>).<\/p>\n<p>&nbsp;<\/p>\n<h6>Proof of the pudding<\/h6>\n<p>Now if I download the same App-V package (250Mb) twice using a browser (again) the <strong>File Cache Memory Usage<\/strong> is still indeed 250Mb, the file cache had one miss (the first download) and one hit (the second download).<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Web-Service-Cache-Tuned.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Web Service Cache - Tuned\" alt=\"Web Service Cache - Tuned\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Web-Service-Cache-Tuned_thumb.png\" width=\"254\" height=\"73\" border=\"0\" \/><\/a><\/p>\n<p>The <strong>Task Manager <\/strong>shows that the resource usage of the background process <strong>IIS Worker Process <\/strong>is now +- <strong>250Mb <\/strong>and the Ethernet adapter still <strong>sends <\/strong>around <strong>100Mbps <\/strong>(to the client) but no longer <strong>downloads <\/strong>the virtual application package from the file server<strong>.<\/strong><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/IIS-Worker-Process-Tuned.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"IIS Worker Process - Tuned\" alt=\"IIS Worker Process - Tuned\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/IIS-Worker-Process-Tuned_thumb.png\" width=\"254\" height=\"231\" border=\"0\" \/><\/a><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Ethernet-usage-Tuned.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; display: inline; background-image: none;\" title=\"Ethernet usage - Tuned\" alt=\"Ethernet usage - Tuned\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2013\/10\/Ethernet-usage-Tuned_thumb.png\" width=\"254\" height=\"231\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1>Load balancer<\/h1>\n<p>If you&#8217;re load balancing your HTTP request using a load balancer you might want to consider caching the App-V sequencers there. I wrote an article about how to achieve this using a Citrix NetScaler:\u00a0<a href=\"https:\/\/ingmarverheij.com\/en\/citrix-netscaler-cache-microsoft-app-v-sequences\/\" target=\"_blank\">Citrix NetScaler: Cache Microsoft App-V sequences<\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>PowerShell<\/h1>\n<p>Patrick Seymour (<a href=\"https:\/\/twitter.com\/PaScoSey\" target=\"_blank\">@PaScoSey<\/a>) wrote a PowerShell script that configures the IIS server with the settings provided above. He provided the script to me and I&#8217;m more then happy to share it with you:\u00a0<a  data-e-disable-page-transition=\"true\" class=\"download-link\" title=\"Version 1.0\" href=\"https:\/\/ingmarverheij.com\/en\/download\/6786\/?tmstv=1778260043\" rel=\"nofollow\" id=\"download-link-6786\" data-redirect=\"false\" >\n\tConfigure-IISForApp-V.ps1<\/a>\n.<\/p>\n<p>The script performs the following actions:<\/p>\n<ul>\n<li>Add a MIME type for .appV files;<\/li>\n<li>Create a folder &#8220;App-V 5 Content&#8221; of the disk with the most amount of free space;<\/li>\n<li>Create a virtual directory for the App-V 5 Content;<\/li>\n<li>Configure\u00a0<a href=\"https:\/\/support.microsoft.com\/kb\/954864\" target=\"_blank\">MaxCachedFileSizeInMB<\/a> to 4096;<\/li>\n<li>Configure\u00a0<a href=\"https:\/\/support.microsoft.com\/kb\/954864\" target=\"_blank\">ObjectCacheTTL<\/a> to 600;<\/li>\n<li>Configure\u00a0<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms692441.aspx\" target=\"_blank\">frequentHitThreshold<\/a> to 1;<\/li>\n<li>Configure\u00a0<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms692441.aspx\" target=\"_blank\">frequentHitTimePeriod<\/a> to 00:00:01.<\/li>\n<\/ul>\n<p><i>Use of this script (or any setting provided in this article) is at your own risk.<\/i><\/p>\n<p>&nbsp;<\/p>\n<p>.<\/p>","protected":false},"excerpt":{"rendered":"<p>With Microsoft App-V 5.0 virtual application packages (or sequences) can be streamed to the client with two delivery methods: SMB or HTTP. With SMB being the easiest one (all you need is a file share), the HTTP delivery mechanism is IMO more scalable. The ability to stream via HTTP is natively built-in in the App-V [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[294],"tags":[599,82,602,603],"class_list":["post-5691","post","type-post","status-publish","format-standard","hentry","category-microsoft-app-v","tag-app-v","tag-caching","tag-http","tag-iis"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/5691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=5691"}],"version-history":[{"count":10,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/5691\/revisions"}],"predecessor-version":[{"id":6791,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/5691\/revisions\/6791"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=5691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=5691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=5691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}