{"id":45271,"date":"2016-05-04T19:35:51","date_gmt":"2016-05-04T16:35:51","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=45271"},"modified":"2019-07-15T12:46:37","modified_gmt":"2019-07-15T09:46:37","slug":"net-on-pivotal-cf-scaling-an-app-on-diego","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/","title":{"rendered":".NET on Pivotal Cloud Foundry: Scaling an App on Diego"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pcf-scaling-diego-v1.png\" alt=\"net-on-pcf-scaling-diego-v1\" width=\"110\" style=\"margin: 0px 0px 0px 10px;\" class=\"alignright size-full wp-image-45272\" \/><\/p>\n<p>Earlier in this blog series, we <a href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cloud-foundry-connecting-and-pushing-an-app\/\">deployed<\/a> a .NET app to Diego on Pivotal CF and <a href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cloud-foundry-adding-a-ms-sql-service-to-an-app\/\">bound<\/a> it to a MS SQL service. However, hardly any cloud app exists as a single instance. So, here, we will scale the demo app horizontally and test how it works on multiple instances.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#Checking_application_scale_settings\" >Checking application scale settings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#Scaling_the_demo_app\" >Scaling the demo app<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#Adding_a_session_state_storage\" >Adding a session state storage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#Modifying_the_demo_app\" >Modifying the demo app<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#Further_reading\" >Further reading<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Checking_application_scale_settings\"><\/span>Checking application scale settings<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>First of all, let\u2019s view the current scale settings with the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf scale<\/code> command:<\/p>\n<pre style=\"padding-left: 30px;\">> cf scale SampleWebApp\r\nShowing current scale of app SampleWebApp in org altoros \/ space dev as example@altoros.com...\r\nOK\r\nmemory: 1G\r\ndisk: 1G\r\ninstances: 1\r\n><\/pre>\n<p><\/p>\n<p>As you can see, we can configure the number of application instances and their size.<\/p>\n<p>For testing purposes, we have added one more view and controller action to our demo app (the source code can be found in <a href=\"https:\/\/github.com\/Altoros\/Altoros-PCF.Net\" target=\"_blank\" rel=\"noopener noreferrer\">this GitHub repo<\/a>). The action puts the number of current instances into the session variable, so we can find out if the session is shared by all instances or not.<\/p>\n<p>After we have published the updated version of <em>SampleWebApp<\/em> into Pivotal CF, we can check the results.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-diego-scaling-session-test.png\" alt=\"net-on-pivotalcf-diego-scaling-session-test\" width=\"389\" height=\"364\" class=\"aligncenter size-full wp-image-45273\" \/><\/center><\/p>\n<p>Apparently, there is only one instance of the application.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Scaling_the_demo_app\"><\/span>Scaling the demo app<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We&#8217;re going to increase the number of instances to three and view the result.<\/p>\n<pre style=\"padding-left: 30px;\">> cf scale SampleWebapp -i 3\r\nScaling app SampleWebApp in org altoros \/ space dev as altoros...\r\nOK\r\n> cf scale SampleWebapp\r\nShowing current scale of app SampleWebApp in org altoros \/ space dev as altoros...\r\nOK\r\nmemory: 1G\r\ndisk: 1G\r\ninstances: 3\r\n><\/pre>\n<p><\/p>\n<p>If we refresh the browser a few times, we will see what is illustrated in the picture below.<\/p>\n<p><center><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png\" alt=\"net-on-pivotalcf-scaling-diego-session-tests\" width=\"640\" class=\"aligncenter size-full wp-image-45274\" \/><\/center><\/p>\n<p>Each time, the application is working as a separate instance that knows nothing about the other ones. To handle this issue, we need to provide a common session and state storage.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Adding_a_session_state_storage\"><\/span>Adding a session state storage<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A session state can be saved in a memory cache solution or some database \/ custom session storage (e.g., Redis or Memcache). For this small project, we chose <a href=\"https:\/\/www.altoros.com\/research-papers\/redis-as-a-service-performance-benchmark-redis-cloud-elasticache-openredis-redisgreen-and-redis-to-go\/\">Redis<\/a>, an open-source cache \/ storage, which is available as a service on Pivotal CF. To enable it, we will use <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-cache-for-redis\/cache-aspnet-session-state-provider\" rel=\"noopener noreferrer\" target=\"_blank\">Microsoft Redis Session State Provider<\/a>.<\/p>\n<p>To create a Redis service and bind it to the application:<\/p>\n<ol>\n<li style=\"margin-bottom: 6px;\">Check what services are available in the marketplace.<\/li>\n<pre style=\"padding-left: 30px;\">> cf marketplace\r\nGetting services from marketplace in org altoros \/ space dev as example@altoros.com...\r\nOK\r\nservice      plans  \t\t       \t   description\r\np-redis      dedicated-vm, shared-vm       Redis service to provide a key-value store\r\nTIP:  Use 'cf marketplace -s SERVICE' to view descriptions of individual plans of a given service.\r\n><\/pre>\n<li style=\"margin-bottom: 6px;\">Create a service instance from the marketplace.<\/li>\n<pre style=\"padding-left: 30px;\">> cf create-service p-redis shared-vm sampleredisservice\r\nCreating service instance sampleredisservice in org altoros \/ space dev as example@altoros.com...\r\nOK\r\n><\/pre>\n<li style=\"margin-bottom: 6px;\">Bind the service instance to the application.<\/li>\n<pre style=\"padding-left: 30px;\">> cf bind-service samplewebapp sampleredisservice\r\nBinding service sampleredisservice to app SampleWebApp in org altoros \/ space dev as example@altoros.com...\r\nOK\r\nTIP: Use 'cf.exe restage SampleWebApp' to ensure your env variable changes take effect\r\n><\/pre>\n<\/ol>\n<p>The Pivotal CF part is ready.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Modifying_the_demo_app\"><\/span>Modifying the demo app<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We still need to modify our .NET app. Let\u2019s add Redis Session Store Provider by using the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=NuGetTeam.NuGetPackageManager\" rel=\"noopener noreferrer\" target=\"_blank\">NuGet<\/a> package manager.<\/p>\n<pre style=\"padding-left: 30px;\">PM> Install-Package Microsoft.Web.RedisSessionStateProvider<\/pre>\n<p>After that, we will enable the app to receive Redis connection strings from the application environment.<\/p>\n<ol>\n<li style=\"margin-bottom: 6px;\">In <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Web.config<\/code>:<\/li>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;sessionstate mode=&quot;Custom&quot; customProvider=&quot;MySessionStateStore&quot;&gt;\r\n  \t&lt;providers&gt;\r\n    \t&lt;add name=&quot;MySessionStateStore&quot; type=&quot;Microsoft.Web.Redis.RedisSessionStateProvider&quot; host=&quot;&quot; accessKey=&quot;&quot; ssl=&quot;true&quot; settingsClassName=&quot;SampleWebApp.Startup&quot; settingsMethodName=&quot;GetRedisConnectionString&quot;&gt;&lt;\/add&gt;\r\n  \t&lt;\/providers&gt;\r\n&lt;\/sessionstate&gt;<\/pre>\n<li style=\"margin-bottom: 6px;\">In <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Startup.cs<\/code>:<\/li>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">public partial class Startup\r\n\t{\r\n \r\n\u2026\r\n \r\n \r\n    \tpublic static string GetRedisConnectionString()\r\n    \t{\r\n        \tvar settings = ParseVCAP();\r\n       \t ConfigurationOptions config = new ConfigurationOptions\r\n        \t{\r\n            \tEndPoints =\r\n                \t{\r\n                    \t{ settings.RedisHost, int.Parse(settings.RedisPort)}\r\n                \t},\r\n            \tCommandMap = CommandMap.Create(new HashSet&lt;string&gt;\r\n            \t{ \/\/ EXCLUDE a few commands\r\n                \t\/*&quot;INFO&quot;, &quot;CONFIG&quot;, &quot;CLUSTER&quot;,\r\n                \t&quot;PING&quot;, &quot;ECHO&quot;, &quot;CLIENT&quot;*\/\r\n            \t}, available: false),\r\n            \tKeepAlive = 180,\r\n            \tDefaultVersion = new Version(2, 8, 8),\r\n            \tPassword = settings.RedisPassword\r\n        \t};\r\n \r\n        \treturn config.ToString();\r\n    \t}\r\n \r\n    \tpublic static Credentials ParseVCAP()\r\n    \t{\r\n        \tCredentials result = new Credentials();\r\n        \tconst string dbServiceName = &quot;mssql-dev&quot;;\r\n        \tconst string redisServiceName = &quot;p-redis&quot;;\r\n        \tstring vcapServices = Environment.GetEnvironmentVariable(&quot;VCAP_SERVICES&quot;);\r\n \r\n        \t\/\/ if we are in the cloud and DB service was bound successfully...\r\n        \tif (vcapServices != null)\r\n        \t{\r\n            \tdynamic json = JsonConvert.DeserializeObject(vcapServices);\r\n            \tforeach (dynamic obj in json.Children())\r\n            \t{\r\n \r\n                    switch (((string)obj.Name).ToLowerInvariant())\r\n                    {\r\n                    case dbServiceName:\r\n                          {\r\n                          dynamic credentials = (((JProperty)obj).Value&#x5B;0] as dynamic).credentials;\r\n                          result.DBHost = credentials?.host;\r\n                          result.DBPort = credentials?.port;\r\n                          result.DBUID = credentials?.username;\r\n                          result.DBPassword = credentials?.password;\r\n                          result.DBConnectionString = credentials?.connectionString;\r\n                          }\r\n                          break;\r\n \r\n                    case redisServiceName:\r\n          \t          {\r\n                          dynamic credentials = (((JProperty)obj).Value&#x5B;0] as dynamic).credentials;\r\n                          result.RedisHost = credentials?.host;\r\n                          result.RedisPort = credentials?.port;\r\n                          result.RedisPassword = credentials?.password;\r\n                          }\r\n                          break;\r\n \r\n                    default:\r\n                          break;\r\n                    }\r\n \r\n           \t }\r\n        \t}\r\n        \treturn result;\r\n    \t}\r\n \r\n\t}\r\n \r\n\tpublic struct Credentials\r\n\t{\r\n    \tpublic string DBUID;\r\n    \tpublic string DBHost;\r\n    \tpublic string DBPort;\r\n    \tpublic string DBPassword;\r\n    \tpublic string DBConnectionString;\r\n    \tpublic string RedisHost;\r\n    \tpublic string RedisPort;\r\n    \tpublic string RedisPassword;\r\n\t}&lt;\/string&gt;&lt;\/pre&gt;\r\n&lt;\/ol&gt;\r\n\r\n&lt;p&gt;Now, we can read Redis settings from an environment variable and put the prepared connection string into the Redis session storage provider.&lt;\/p&gt;\r\n\r\n&amp;nbsp;\r\n&lt;h3&gt;CF push!&lt;\/h3&gt;\r\n\r\n&lt;p&gt;Finally, we can publish the app to Pivotal CF and check the result.&lt;\/p&gt;\r\n\r\n&lt;pre style=&quot;padding-left: 30px;&quot;&gt;cf push SampleWebApp -p .\\ -s windows2012R2 --no-start -b\r\ncf enable-diego SampleWebApp\r\ncf start SampleWebApp<\/pre>\n<p>The output:<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pvotal-cf-scaling-diego-session-test-1.png\" alt=\"net-on-pvotal-cf-scaling-diego-session-test\" width=\"540\" height=\"542\" class=\"aligncenter size-full wp-image-45275\" \/><\/center><\/p>\n<p>As you have probably noticed, all the session data is shared between instances. This means the application is working well.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cloud-foundry-connecting-and-pushing-an-app\/\">.NET on Pivotal CF: Connecting and Pushing an App<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cloud-foundry-adding-a-ms-sql-service-to-an-app\/\">.NET on Pivotal CF: Adding a MS SQL Service to an App<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><center><small>This post was written by <b>Raman Yurkin<\/b>, edited by <a href=\"https:\/\/www.altoros.com\/blog\/author\/sophie.turol\/\">Sophia Turol<\/a> and <a href=\"https:\/\/www.altoros.com\/blog\/author\/alex\/\">Alex Khizhniak<\/a>.<\/small><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<\/p>\n<p>Earlier in this blog series, we deployed a .NET app to Diego on Pivotal CF and bound it to a MS SQL service. However, hardly any cloud app exists as a single instance. So, here, we will scale the demo app horizontally and test how it works on multiple instances.<\/p>\n<p>&nbsp;<\/p>\n<p>Checking [&#8230;]<\/p>\n","protected":false},"author":88,"featured_media":45274,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[873,28],"class_list":["post-45271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cloud-native","tag-pivotal-cf"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>.NET on Pivotal Cloud Foundry: Scaling an App on Diego | Altoros<\/title>\n<meta name=\"description\" content=\"This tutorial explains how to scale and modify a sample app, add a session state storage, test it on multiple instances, and push it to Pivotal CF.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\".NET on Pivotal Cloud Foundry: Scaling an App on Diego | Altoros\" \/>\n<meta property=\"og:description\" content=\"Earlier in this blog series, we deployed a .NET app to Diego on Pivotal CF and bound it to a MS SQL service. However, hardly any cloud app exists as a single instance. So, here, we will scale the demo app horizontally and test how it works on multiple instances. &nbsp; Checking [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-04T16:35:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-15T09:46:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png\" \/>\n\t<meta property=\"og:image:width\" content=\"646\" \/>\n\t<meta property=\"og:image:height\" content=\"256\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Raman Yurkin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Raman Yurkin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/\",\"name\":\".NET on Pivotal Cloud Foundry: Scaling an App on Diego | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png\",\"datePublished\":\"2016-05-04T16:35:51+00:00\",\"dateModified\":\"2019-07-15T09:46:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/e8d9865cc792d5c8d3c3346a4dccb305\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png\",\"width\":646,\"height\":256},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\".NET on Pivotal Cloud Foundry: Scaling an App on Diego\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/e8d9865cc792d5c8d3c3346a4dccb305\",\"name\":\"Raman Yurkin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/roman-yurkin-96x96.jpeg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/roman-yurkin-96x96.jpeg\",\"caption\":\"Raman Yurkin\"},\"description\":\"Raman Yurkin is Solutions Architect at Altoros. It is hard to list all the programming languages and technologies he has worked with over the last 20 years, but, today, his main focus areas are the .NET stack, Microsoft Azure, and PaaS.\",\"url\":\"https:\/\/www.altoros.com\/blog\/author\/roman-yurkin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":".NET on Pivotal Cloud Foundry: Scaling an App on Diego | Altoros","description":"This tutorial explains how to scale and modify a sample app, add a session state storage, test it on multiple instances, and push it to Pivotal CF.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/","og_locale":"en_US","og_type":"article","og_title":".NET on Pivotal Cloud Foundry: Scaling an App on Diego | Altoros","og_description":"Earlier in this blog series, we deployed a .NET app to Diego on Pivotal CF and bound it to a MS SQL service. However, hardly any cloud app exists as a single instance. So, here, we will scale the demo app horizontally and test how it works on multiple instances. &nbsp; Checking [...]","og_url":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/","og_site_name":"Altoros","article_published_time":"2016-05-04T16:35:51+00:00","article_modified_time":"2019-07-15T09:46:37+00:00","og_image":[{"width":646,"height":256,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png","type":"image\/png"}],"author":"Raman Yurkin","twitter_misc":{"Written by":"Raman Yurkin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/","url":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/","name":".NET on Pivotal Cloud Foundry: Scaling an App on Diego | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png","datePublished":"2016-05-04T16:35:51+00:00","dateModified":"2019-07-15T09:46:37+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/e8d9865cc792d5c8d3c3346a4dccb305"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/net-on-pivotalcf-scaling-diego-session-tests.png","width":646,"height":256},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/net-on-pivotal-cf-scaling-an-app-on-diego\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":".NET on Pivotal Cloud Foundry: Scaling an App on Diego"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/e8d9865cc792d5c8d3c3346a4dccb305","name":"Raman Yurkin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/roman-yurkin-96x96.jpeg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2019\/07\/roman-yurkin-96x96.jpeg","caption":"Raman Yurkin"},"description":"Raman Yurkin is Solutions Architect at Altoros. It is hard to list all the programming languages and technologies he has worked with over the last 20 years, but, today, his main focus areas are the .NET stack, Microsoft Azure, and PaaS.","url":"https:\/\/www.altoros.com\/blog\/author\/roman-yurkin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/45271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/88"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=45271"}],"version-history":[{"count":15,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/45271\/revisions"}],"predecessor-version":[{"id":45336,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/45271\/revisions\/45336"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/45274"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=45271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=45271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=45271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}