![]() Most of this will matter no matter what type of server you are using, locally or in production. This includes both performance issues related to starting up, under the "cold start" section. See this article for tips on how to help performance issues. Using (StreamReader sr = new StreamReader(data))Ĭonsole.WriteLine (String.Format("",DateTime.Now,ex.Message)) ![]() Stream data = response.GetResponseStream() WebResponse response = request.GetResponse() WebRequest request = WebRequest.Create(URL) WebKeepAlive.Interval = 480000 // every 8 minutes ONLY the first time it retrieves the content it will print the string Private void WebKeepAlive_Elapsed(object sender, e) WebKeepAlive.Elapsed += WebKeepAlive_Elapsed NOTE: In LinqPad you'll need to press F4 and add a reference to System.Net to add the library which will retrieve your page.ĪLSO : make sure you change the String URL variable to point at a URL that will load a route from your ASP.NET MVC site so the engine will run. Get LinqPad and you can run the following script - just change the URL to your own and let it run and you can test this easily. This gives me a good idea that most likely the slowness I was experiencing was because of ASP.NET MVC startup times. While the script was running I hit my web site and every time my site came up blazingly fast. Then, after hitting that HTML page I'd hit one of my ASP.NET MVC URLs and I'd get the Chrome message "Waiting for ."Īfter that I wrote a LINQPad (check out for more) script that would hit my web site every 8 minutes (less than the time for the app to unload - which should be 20 minutes) and I let it run for hours. I loaded an HTML page at any time and it would load blazing fast. That's how I first recognized that the problem was in the ASP.NET MVC startup. If the problem is related to ASP.NET MVC start up then the HTML page will render almost immediately even when the web app hasn't been started. Drop a normal HTML page on your site where you can hit it directly. There's another way to test if it is your ASP.NET MVC start up or something else. My site takes at least 30 seconds when it hasn't been hit in over 20 minutes (and the web app has been stopped). You have to remember that none of the machine configuration options are available if you are hosted on a shared server as many of us (smaller companies and individuals) are. Periodically recycled to avoid unstable states that can lead toĪpplication crashes, hangs, or memory leaks.Īs long as app pool recycling is left on, it should be enough.īut if you really want top notch performance for most components, you should also use something like the Application Initialization Module you mentioned. Internet Information Services (IIS) application pools can be The price being that one time slow load time.īesides the fact that the app pool gets shutdown in case of user inactivity, the app pool will also recycle by default every 1740 minutes (29 hours). Using C, setting the idle timeout, should be enough so that subsequent requests to the server are served fast (restarting the app pool takes quite some time - in the order of seconds).Īs far as I know, the timeout exists to save memory that other websites running in parallel on that machine might need. Options A, B and D seem to be in the same category since they only influence the initial start time, they do warmup of the website like compilation and loading of libraries in memory. I eventually just had to make a warm up script to hit my site occasionally to make sure it stayed speedy. See this question, which unfortunately hasn't been answered yet has been answered! Performing C seems to be enough to keep my site warmed up, but I've discovered that the real root of my site's slowness has to do with Entity Framework, which I can't seem to figure out why it's going cold. I'm wondering which of these is preferred, and more importantly, why are there so many solutions to the same problem? (My guess is they aren't, and I'm just not understanding something correctly). Disable the idle-timeout (under IIS Reset) Use the Application Initialization pluginĬ. I've been looking for a solution to the problem and I've found these potential solutions.Ī. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 Classic Utility Jacket $110.00 In stock XS S M L XL Buy now Add to bag Free shipping on all continental US orders.IIS has an annoying feature for low traffic websites where it recycles unused worker processes, causing the first user to the site after some time to get an extremely long delay (30+ seconds).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |