Launching EPIserver website from Visual Studio takes at least 5 minutes - asp.net-mvc

I do not know if this is a Visual Studio, ASP.Net-MVC, IIS Express or EPIserver issue.
The problem is that in Visual Studio, when I click on what looks like a play icon, it takes at least 5 minutes until my local EPIserver development website loads in the browser.
I have tried selecting different browsers from within Visual Studio: Firefox, Chrome, MS Edge.
We have also tested this on 2 identical laptops, and 2 identical desktops. All running the latest Windows 10.
What happens is that about 4-5 seconds after I click on play, a browser instance will be launched. This is pointing to localhost. It then takes at least 5 minutes for the website to start loading in the browser.
This is making it really hard to work efficiently.
I would be very thankful for any tips on what to try, what to check, etc..
I am a relatively new users when it comes to all of the above mentioned components, so I would be very thankful for step by step tips on what to check/test.

Enable log4net logging (usually config file called EPiServerLog.config in the site root) using a relevant appender with debug-level logging.
The logs can probably show you what happens after the site has started. I have seen examples where poor implementations have, for example, iterated all content on a site on startup, causing a ton of database traffic as the cache is populated. Needless to say that takes a long time. :)
If the logs don't give anything away, I would suggest attaching the VS debugger to do some basic profiling on startup.
Example on configuring log4net, albeit an old post.

Related

Umbraco 7 Content editor randomly hangs when generating thumbnails

Umbraco 7.6.6, running under IIS 8.5 on fully patched Windows Server 2011 R2 Standard, 64bit.
Our content editors notice that often when they create a new article (which has some graphics specified) the system hangs after they try to browse to a different article... or indeed anywhere in the front-end site, too. It only affects them; other users are still able to browse and/or create content.
F12 dev tools shows that browser is pending the result of this type of call:
http://whatever.com/media/1101/thumbnail_pmc-1x2.jpg?width=500&mode=max&animationprocessmode=first
If I try to view that thumbnail without the querystring data, it loads instantly... while the first call is still hanging in it's unresponsive tab:
http://whatever.com/media/1101/thumbnail_pmc-1x2.jpg
DEBUG level Umbraco logs just show this:
2017-10-10 17:02:53,120 [P2816/D6/T57] DEBUG Umbraco.Web.UmbracoModule - Begin request: http://whatever.com/media/1101/thumbnail_pmc-1x2.jpg?width=500&mode=max&animationprocessmode=first.
No errors in the umbraco logs, no errors in IIS logs, nothing in event viewer.
Best I can tell, something is going wonky in the browser. Can anybody please advise on how I can troubleshoot further?
Thanks!

Visual Studio 2015 ASP.Net MVC page becomes unresponsive after debugging for about a minute

When I am running an MVC app in debug mode in vs 2015 community with Update 3, the page becomes unresponsive after about a minute even though debugging is still active. It's as if the page loses it's connection to the running vs instance. When I attempt to refresh the page or navigate elsewhere in the app, it just sits there trying to load but never does. I always have to restart debugging. This is really annoying as a developer to constantly have to restart the site - especially when only making javascript or html changes.
I believe this started approximately 6 weeks ago. I don't recall any change or addition that preceded it. At first I thought it was just with one solution or browser but have since confirmed it is with every solution and 3 different browsers. During this time I installed the same setup on another computer only to have the same problem.
Is there a setting or something I don't know about that causes this?

razor performance on web server much slower than using VS development server

I have an MVC 3 application where browser page loads are much faster when running in debug mode using VS2010 and the VS Development server on my desktop (windows 7 with 8GB RAM) than they are when loading from an actual web server (a virtualized 2008 server running IIS 7.5 and hosted on an Intel box with twin Xeon CPUs on the same LAN as my desktop). Just the opposite of what one would expect and hope for.
To help figure out what is going on I added code to log the start and end times corresponding to executing the controller code and the razor code as well as the interval between the two. I repeatedly switched between loading the instrumented page and another web page in the same application in my browser (FF) then looked at the logs from both servers. (FYI the pages in question are loaded via Ajax so there's no caching on the browser side)
I skipped the initial cycle which included the time to compile the razor code and averaged the results over the subsequent 5 load cycles although the numbers for all the repetitions were pretty similar.
The controller code execution time was 133 msecs for IIS vs 113 for my dev server. Somewhat surprising considering that the dev server was running the debug version and IIS the release version but not significant at least from a user perspective.
However the razor execution time was 823 msecs for IIS vs 72 msecs for my dev server, over an order of magnitude difference!! At first I though perhaps the razor code was always getting recompiled on IIS but the logging showed a large time lapse between end of controller execution and start of razor execution for the first load and only a few msecs for all subsequent loads for both IIS and the VS dev server so it seems clear that the compiled razor code is being used in both cases.
I verified that both were running as 32 bit apps (by logging the size of intptr) and also that Enable 32 bit apps was set true in the IIS app pool settings (also set to v4 and integrated mode).
I verified that the IIS version was running the release code and the dev server the debug code (by logging HttpContext.IsDebuggingEnabled in controller)
I also repeated the experiment with other pages in my app and they all show the same loading behavior for pages of similar complexity so it does not appear to be something funny with that particular page (much simpler pages did load more quickly as one would expect)
So far what I've concluded from these results are:
It's not likely a difference in resources on the two boxes as the execution time of the controller code is virtually the same and there was no other significant traffic on the virtual server besides me at the time of the tests.
It's not due to a failure to cache and reuse the compiled razor code (evident from the time pattern in the logs)
It's not likely due to the application as all the pages of similar complexity experience similar problems
It's not a browser side issue as the same browser instance was used to view both.
It's not a 64 vs 32 bit issue as both are apparently using 32 bits.
It's also not some difference in the code because I published the code to the web server at the same time I performed the tests ( and they both have the new logging code I added).
I considered the possibility it could be the LAN (because presumably the razor code is being rendered and sent at the same time it is executing rather than being buffered and sent after rendering) but the payload is only around 140KB (from Net tab in Firebug) and the LAN is 100MB switched. To help eliminate this as a factor I found a file of around 240KB on a file share on the same web server and copied it to my desktop. The transfer was almost instantaneous. Certainly nowhere near 800 msecs.
So far I am stumped as to what may be causing this 700+ msec additional time when rendering on the web server.
UPDATE: I succeeded in getting IIS 7 installed on my desktop and pointing directly at my project. Page loads are as snappy as they are using the VS development server so it does not appear to be simply an IIS vs VS Dev Server issue.
UPDATE: I've added code to print out Environment.Version.
Dev Box: 4.0.30319.468
Web Server: 4.0.30319.1
I'm going to figure out how to update the web server. Also not sure if this is the whole story. Perhaps the MVC dll's have separate versioning but don't know yet how to figure it out.
I also find it curious that even after publishing (when I have built the release version), when I run my local web server (which points at the same folder that is published) it shows debug mode.
UPDATE: I checked and it appears that I'm providing all the Razor dlls in the project's bin folder and thus they should be the same on the server and the desktop. Presumably MVC will check first in the bin then the GAC.

ActiveX cannot screen capture a page that is hosted on the same server

I have an app that takes a screenshot of web pages and creates a resized image. The app is basically loading a web page that calls an ActiveX to load a web page using IE resources and take the screenshot. This app has been running on a Windows Server 2003 without any problems for a couple of years.
But now that I have upgraded the server to Windows Server 2008, the screenshot action is timing out. From tests I can see that it successfully takes a screenshot of any web page hosted on the Internet... except pages hosted on the same server.
Whenever it tries to capture a page loaded on a site hosted on the same server as the app, it times out. ESC is disabled and it seems that all other permissions are ok, ie: it works for remote pages but for home pages.
Any ideas as to what can be causing this and how to fix it?
After further testing I have narrowed down the reason for failure being due to the page being popluated from a MS-SQL database record on the same server as the one taking the screenshot. The same page generated on a remote server captures ok. I have further established that the error is not peculiar to the ACASystems DLL because it also affects another DLL for creating MHT files from web pages. This DLL (Chilkat.MHT) also uses IE to load and assemble the web page on the fly and then saves it as a.mht file.
So the problem is more related to IE assembling web pages from MS-SQL while running ActiveX. But to resolve this enigma?
Maybe a routing issue (DNS/hostfile..) ? Does the page loads on local session with IE ?
There is no solution for this without editing the ActiveX code. Since the DLLs in question are third party resources, such editing is not possible.
After testing 3 different ActiveX that load a web page that either take a screenshot or save as .mht, it was found that they all failed when loading a page that was querying SQL on the same server. After contacting the 3 DLL developers we were informed by all of them that their ActiveX has no impact on MS-SQL.
Unfortunately, our tests tell us otherwise. At this stage we are left guessing however this article about in-process vs out-process execution may be related.
The workaround for us to solve this problem was to assemble the page to be captured from request queries passed to the page rather than populate from SQL queries. This alternate works perfectly.

Site not completely loaded in the browser

I have a MVC 3 project hosted on IIS 5.1.
80% of the time everything is working fine, but often when the connection is slow, the page is not loaded completely in the user's browser. The loading finishes fast, but certain CSS definitions and images are not loaded and not displayed in the browser.
I tried it with Firefox and IE and the results are the same.
Is it IIS 5.1 that causes this problem?
Did you try to find out why the css and images are not loaded? E.g. with Firebug or Fiddler? It would be helpful to see what status code you get back.
Could it be that the site is accessed by my multiple users at the same time? Since you are using IIS 5.1 I assume you are using Windows XP Professional. As far as I can remember Windows XP Professional has a limit of 10 simultaneous inbound connections. So if you access it with multiple users at the same time you might be hitting that limit as most browsers open 4 to 6 connections per domain/website.
Edit by xsl: Here is how you up the connection limit on IIS5 to the hard-coded maximum of 50: http://weblogs.asp.net/cazzu/archive/2003/10/10/31476.aspx

Resources