{"id":42,"date":"2024-11-22T06:40:07","date_gmt":"2024-11-22T06:40:07","guid":{"rendered":"https:\/\/prageeth.online\/?p=42"},"modified":"2025-09-05T13:15:47","modified_gmt":"2025-09-05T13:15:47","slug":"coldstart-improvements-in-legacy-but-money-making-dotnet-applications","status":"publish","type":"post","link":"https:\/\/prageeth.online\/?p=42","title":{"rendered":"Coldstart improvements in legacy dotnet applications"},"content":{"rendered":"\n<p>Before we dive into the details, let\u2019s clarify what a cold start is. <em>Cold start <\/em>refers to a problem where a system or its part was created or restarted and is not working at its normal operation[1].<\/p>\n\n\n\n<p>I&#8217;m going to talk about how quickly a web application can handle a request from the cold. It&#8217;s important to understand that some of the legacy applications have to deal with cold start depending on the server that&#8217;s hosted. In this example, let\u2019s take IIS. You may be thinking, why on earth are you using IIS? But the truth is most of the well-established .NET Framework-based web applications still use IIS.\u00a0<\/p>\n\n\n\n<p><br>There are a few things you can do in IIS to do things faster. Before talking about that, let\u2019s see why things start slowly.<\/p>\n\n\n\n<p><br>First, take a closer look at the startup. There can be many things there, from dependency injection to creating resources such as pub sub-topics and subscriptions. Strangely, there could be some compilation processes in there, creating artifacts that can be consumed later. None of these approaches may be wrong at the time of implementation. However, money-making applications have a tendency to grow rapidly in terms of features as well as users. Eventually, you will start having scaling and performance issues.&nbsp;<\/p>\n\n\n\n<p><br>How can we resolve some of the issues?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use an application performance monitor and analyse the startup process end to end. Most tools will provide the processing time of each method.<\/li>\n\n\n\n<li>Identify the methods that take too long to process. How long is too long depends on the KPIs.<\/li>\n\n\n\n<li>Introduce solutions that can cut down the time. In my experience, some of the logic in the startup doesn&#8217;t need to happen in the startup anymore. Some of those requirements may have changed, or the part of the functionality is never being used.<\/li>\n\n\n\n<li>Think about implementing lazy loading and distributed caching.<\/li>\n\n\n\n<li>Make sure the dependency services have a relatively quick startup time. If not, work on them as well as the current service.<\/li>\n<\/ul>\n\n\n\n<p>There are quick wins you can get by fine-tuning the IIS.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the application pool setting <em>Start Mode<\/em> to <em>Always Running<\/em> &#8211; This feature will make the app pool keep running without letting it go cold.<\/li>\n\n\n\n<li>Set the application pool setting Recycling <em>Regular time interval<\/em> to <em>0<\/em> &#8211; This will disable the periodic recycling. Make sure to keep an eye on the memory use of the app. This can lead to memory leaks if the app doesn\u2019t have good memory management.<\/li>\n\n\n\n<li>Change the app pool recycling times to make sure your customers are not affected.<\/li>\n\n\n\n<li>Enable <em>Application Initialisation<\/em> feature[2] &#8211; This will proactively perform initialisation tasks. When the IIS restarts, this will warm up the sites.<\/li>\n<\/ul>\n\n\n\n<p><br>These setting changes will help to give a little boost to the cold start time while you are focusing on the code improvements.<\/p>\n\n\n\n<p>Always test the changes in the downstream environments, such as QA or UAT before making changes in production workloads. This includes the IIS changes. With legacy applications, it&#8217;s hard sometimes to predict how the application behave to the changes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">References<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Cold_start_(computing)#:~:text=Cold%20start%20in%20computing%20refers,working%20at%20its%20normal%20operation.\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Cold_start_(computing)#:~:text=Cold%20start%20in%20computing%20refers,working%20at%20its%20normal%20operation.\">Cold Start &#8211; Wikipedia<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/iis\/get-started\/whats-new-in-iis-8\/iis-80-application-initialization\">IIS 8.0 Application Initialisaton<\/a> <\/li>\n<\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before we dive into the details, let\u2019s clarify what a cold start is. Cold start refers to a problem where a system or its part was created or restarted and is not working at its normal operation[1]. I&#8217;m going to talk about how quickly a web application can handle a request from the cold. It&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,4,6],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-blog","tag-iis-cold-start","tag-legacy-net-framework-apps","tag-slow-loading-iis-apps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Coldstart improvements in legacy dotnet applications - Prageeth&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prageeth.online\/?p=42\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Coldstart improvements in legacy dotnet applications - Prageeth&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"Before we dive into the details, let\u2019s clarify what a cold start is. Cold start refers to a problem where a system or its part was created or restarted and is not working at its normal operation[1]. I&#8217;m going to talk about how quickly a web application can handle a request from the cold. It&#8217;s [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prageeth.online\/?p=42\" \/>\n<meta property=\"og:site_name\" content=\"Prageeth&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-22T06:40:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-05T13:15:47+00:00\" \/>\n<meta name=\"author\" content=\"Prageeth Sudusinghe\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prageeth Sudusinghe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=42#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=42\"},\"author\":{\"name\":\"Prageeth Sudusinghe\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/#\\\/schema\\\/person\\\/09643dd33af2fedc7621364fcc9875c1\"},\"headline\":\"Coldstart improvements in legacy dotnet applications\",\"datePublished\":\"2024-11-22T06:40:07+00:00\",\"dateModified\":\"2025-09-05T13:15:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=42\"},\"wordCount\":535,\"commentCount\":0,\"keywords\":[\"IIS Cold Start\",\"Legacy .NET Framework apps\",\"Slow loading IIS apps\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/prageeth.online\\\/?p=42#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=42\",\"url\":\"https:\\\/\\\/prageeth.online\\\/?p=42\",\"name\":\"Coldstart improvements in legacy dotnet applications - Prageeth&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/#website\"},\"datePublished\":\"2024-11-22T06:40:07+00:00\",\"dateModified\":\"2025-09-05T13:15:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/#\\\/schema\\\/person\\\/09643dd33af2fedc7621364fcc9875c1\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=42#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/prageeth.online\\\/?p=42\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/?p=42#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/prageeth.online\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Coldstart improvements in legacy dotnet applications\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/#website\",\"url\":\"https:\\\/\\\/prageeth.online\\\/\",\"name\":\"Prageeth's Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/prageeth.online\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/prageeth.online\\\/#\\\/schema\\\/person\\\/09643dd33af2fedc7621364fcc9875c1\",\"name\":\"Prageeth Sudusinghe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g\",\"caption\":\"Prageeth Sudusinghe\"},\"sameAs\":[\"http:\\\/\\\/prageeth.online\"],\"url\":\"https:\\\/\\\/prageeth.online\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Coldstart improvements in legacy dotnet applications - Prageeth&#039;s Blog","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:\/\/prageeth.online\/?p=42","og_locale":"en_US","og_type":"article","og_title":"Coldstart improvements in legacy dotnet applications - Prageeth&#039;s Blog","og_description":"Before we dive into the details, let\u2019s clarify what a cold start is. Cold start refers to a problem where a system or its part was created or restarted and is not working at its normal operation[1]. I&#8217;m going to talk about how quickly a web application can handle a request from the cold. It&#8217;s [&hellip;]","og_url":"https:\/\/prageeth.online\/?p=42","og_site_name":"Prageeth&#039;s Blog","article_published_time":"2024-11-22T06:40:07+00:00","article_modified_time":"2025-09-05T13:15:47+00:00","author":"Prageeth Sudusinghe","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prageeth Sudusinghe","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prageeth.online\/?p=42#article","isPartOf":{"@id":"https:\/\/prageeth.online\/?p=42"},"author":{"name":"Prageeth Sudusinghe","@id":"https:\/\/prageeth.online\/#\/schema\/person\/09643dd33af2fedc7621364fcc9875c1"},"headline":"Coldstart improvements in legacy dotnet applications","datePublished":"2024-11-22T06:40:07+00:00","dateModified":"2025-09-05T13:15:47+00:00","mainEntityOfPage":{"@id":"https:\/\/prageeth.online\/?p=42"},"wordCount":535,"commentCount":0,"keywords":["IIS Cold Start","Legacy .NET Framework apps","Slow loading IIS apps"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prageeth.online\/?p=42#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prageeth.online\/?p=42","url":"https:\/\/prageeth.online\/?p=42","name":"Coldstart improvements in legacy dotnet applications - Prageeth&#039;s Blog","isPartOf":{"@id":"https:\/\/prageeth.online\/#website"},"datePublished":"2024-11-22T06:40:07+00:00","dateModified":"2025-09-05T13:15:47+00:00","author":{"@id":"https:\/\/prageeth.online\/#\/schema\/person\/09643dd33af2fedc7621364fcc9875c1"},"breadcrumb":{"@id":"https:\/\/prageeth.online\/?p=42#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prageeth.online\/?p=42"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/prageeth.online\/?p=42#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prageeth.online\/"},{"@type":"ListItem","position":2,"name":"Coldstart improvements in legacy dotnet applications"}]},{"@type":"WebSite","@id":"https:\/\/prageeth.online\/#website","url":"https:\/\/prageeth.online\/","name":"Prageeth's Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prageeth.online\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prageeth.online\/#\/schema\/person\/09643dd33af2fedc7621364fcc9875c1","name":"Prageeth Sudusinghe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ae7bb7d0b6022dfc0b9c25981bb75f0424b82c2b8aaec687155f47cd66cda3ca?s=96&d=mm&r=g","caption":"Prageeth Sudusinghe"},"sameAs":["http:\/\/prageeth.online"],"url":"https:\/\/prageeth.online\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":3,"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/prageeth.online\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prageeth.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}