Glimpse lost account of time? Slow web form requests - asp.net

I just installed glimpse to try and track down some slow loading on pages that basically don't do much. This issue happens on local(not as bad though) but worse on pre production server.
I see the start request, then nothing.. then all the SQL and page cycles (yes, still damn web forms) all go quickly ~800ms. For an empty site that is is pretty shite but the problem is it takes 2,3 sometimes 6 seconds and I cannot work out why.
Anybody know how to work out the missing piece?
On the lifecycle it looks like its already delayed 1916.02ms What comes before the lifecycle of webforms?

Here are a few things you can look into:
Is this only happening on the first hit to the page? (IE: Is this JIT overhead?)
Do you have any HTTP Modules doing work during BeginRequest?
What about Global.asax and BeginRequest?
You can add System.Diagnostics.Trace.Write() statements in your BeginRequest and look at the Trace tab and Timeline tabs to get more information about the time in the red box.

Related

Huge loading time on some pages

Here is my page URL: www.1800-gifts.com/USA/Cake-Delivery and other pages like that all are loading very slow even i have caching , compression enabled, i have tried to call go daddy which is my hosting provider but they do not respond positive.
Developer is telling me that it is a server issue, but i don't find any issues in server it is fine.
This website is developed in asp.net 4.0, database is mssql 2012 r2.
server is VPS, with 2 gb of ram, I have 2 GB data in database, and some table contains more than 100k records.
Please look at my site and give me suggestions, i have checked in google page speed and other tools they are all saying different views.
I am not sure if this is the cause but if you enable developer mode (F12) and run the site in chrome you will see that the cake-delivery page is the one that is causing the loading time (44s). You will also notice that there are JQuery errors on the page.
This could possibly be part of the problem.
EDIT:
After looking at the linked page I think Erik is right, JQuery is not the issue.
The person that is developing the site needs to revisit the way the page works completely. There is a massive amount of operations happening in the page load of the page. The operations that are used are also hack and slash ways of doing things that there is already built in methods for. This is simply a page taking forever to load due to bad coding.
I would suggest the developer returns to the drawing board.
There are a lot of great tools that look at your page and tell you what might be wrong with it. Analyzing your page with GTmetrix for example gives you this. There are also important tips you can work on right away, for example:
gzip compression
Minifying css, html and js
Concatenating scripts
and a lot more. I also recently wrote an article showing important optimization for web performance
Looking at the waterfall chart of your page (also available on GTmetrix) shows that the biggest problem is indeed your server. It takes 16 seconds to receive an answer for the first request (time-to-first-byte). There is clearly something wrong!
There are a lot of things that could be wrong on your server. You should test your database queries (are they slow? How many are performed for a page load?).

Diagnose website slow startup AJAX ASP.NET

I've a Ajax .net website which follows this structure :
Control (ascx) : TopMenu, LeftPanel, RightPanel, Footer, all are very simple controls and don't require any connection to database or server side code !
One div body (ajax)
Everytime the website starts, the 4 controls load first, then comes the Ajax body. The performance is pretty good in development environment.
But when i uploaded the precompiled site to the host, it always take quiet long for starting up, after the first load, the performance is good
What i can't understand is : as far as i know, the four ascx control will be rendered first, that means the page will be loaded to the client, after that is the ajax content. So what's causing the performance on start up ?
P/s :
i did set the key compilation=false in web.config
i compiled the site using Publish tool in VS 2010 (Release mode and not allow updatatable ... )
i have no images on the site, it's a very simple site
i've checked similar topics, and event posted a question not so long ago about
this, but still without success
my site: http://iketqua.net
From your site and running the Network Analysis on google chrome what is blocking the render of your site is a huge delay for make a lot of calculations on page load, there is a lot of time that takes to start get data.
Also the google analytic script, must be placed on bottom of your page, together with other external scripts for google plus, facebook like etc.
Also there are 2 fonts on this css, that can not be load, and this takes almost 3 seconds delay.
http://iketqua.net/Styles/Fonts/MyriadPro/font.css
(source: planethost.gr)
If you are referring to the very first request after deployment to production. I don't think there's anything you can do about it. ASP.NET first request will always be slow, even if it is a pre-compiled site because the server still needs to load resources on the server-side.
But, if you are talking about first load from the client-side perspective, by just running Chrome Developer Tools I can see that your site's home page is quite heavy (44 requests, ~4 seconds to load) which explains why the first load takes some time and sub-sequent requests are quicker...mainly, because most of those 44 requests get cached by the browser. Now, in your dev environment it happens quickly because there is no significant network latency or connection hops, once you move to production the network lantency and connection hops plays a big role in performance...that's why many sites use CDNs.
Suggestions
Make your site lighter. There's many things you can avoid. For example:
This background image (http://iketqua.net/img/header_bg.png) is useless because it is a plain color which you can easily achieve that using css. That'll translate to one request less
Bundling and minification tools to minify and merge style sheets and js files
Optimize your css. Take the time to review your css and clean it. I can't believe that such a simple page can be requesting 9 css files...probably most of them are coming from open source frameworks (jQuery UI, DatePick, etc)
I lack permissions to post this as a comment, but if it's fine in the development environment, it may be something as simple as ability of the host or the connection to the host.
After the first load, the performance is good
I'd be inclined to think this is due to the site being cached.

What exact settings required in iis for asp.net pages to process it faster?

I am having a simple blank page without any source code.The page also taking very long time to come.I am not able to understand the reason behind this.
The domain is getting a high requests.
What exact settings needs to be done in iis 7.0 so that it will be faster.
Please help.
ASP.NET pages always have an initial delay when the first request is made after the file has been created/edited/uploaded because the server needs to recompile them, however it shouldn't be more than 2-3 seconds in practice, and does not affect subsequent pageloads.
The only thing I can think of is an overloaded server. Assuming you're on a shared hosting package then I recommend you find another ISP. If not, then I'm afraid there's a lot more to it than just a "page pages load faster" switch hidden away.

slow of first page, running on windows/IIS

I'm more into the LAMP stack, but I've been asked to work on a site that is running Windows and IIS 2008. I'm a beginner with IIS, so please be patient with me on this, and please ask me to provide more information if that is needed to determine.
I read the answer here (Slow first page load on asp.net site), but it seems like if I go to the site with one browser it takes long to load the first page, then fast on all other pages, then if I open up another browser, it's the same thing, so it's not something that is saved on the server, but per session?
Is there a way to have the application running at all times?
Right now it is taking 12 to 15 seconds for the first page to load.
I have access to the WebControlCenter and FTP.
I would look in the Global.asax page and see if there is anything going on when a session is started. There usually is a method in there called Session_Start that is called whenever a session is started. Also, it might have to do with the site being configured in debug mode. You can change the web.config setting to false, which has a big impact on performance.
I'm familiar with the phenomenon described in the question you've linked to, but your what you're describing does seem a bit odd.
firstly- try Jeff's suggestion and see if indeed there's something at the beginning of the session which slows it down.
If not- try answering this-
1. is the first page always slow or only on first access to it?
2. what happens if you open another tab in the browser (not a different browser)?
3. it's possibel that the page contains some heavy resources (like images, script files etc.) which are only downloaded on the first access to the page. try tracing your http responses you get and see what their sizes are.
4. try to enable trace on your web page to see the events which are taking the longest time (on aspx you need to add 'Page Trace="true"' to the page declaration)
hope one of these helps...
Have you tried a http debugger here? Lots of things could be going on here, but the fact that you get different behavior by using different browsers indicates it is probably some particular resource that is overweight.

How to Test an AJAX Installation

Is there a simple and foolproof way we can test an AJAX installation? We have a problem in calling a webscript using AJAX form a JS file. The error is 'ServiceLib' is not defined. The error gets a few hits on Google.
We've added some AJAX functionality to a customer's app. This works fine here in the office on dev machines and on our IIS Server, it works fine on the customer's test web site, but when we put the app on the live site, the webscript calls fail.
The customer installed AJAX on their live server a few days ago. We've verified that the service lib files are there and in the right places.
We've already spent hours on this with no solution and still do not know for sure whether there is something wrong with our code, or something is wrong on their server, or for that matter, whether AJAX is even correctly installed. Part of our problem is that we have no access to their live server, so there is not much we can do other than change lines in our own code, give the app files to our contact there, and see what happens. The contact knows less than we do, so we are working blind. A strange situation, I know, but there is beaurocracy involved.
Many thanks
Mike Thomas
Firebug might help - if you can get someone at the far end to install it, it may be able to give you an insight into what is going on with the ajax requests via its console, which logs and gives you the ability to view the return data of all ajax requests.
I'm thinking...
There are three parts to the process:
1) The client-side javascript logic in the browser sends the HTTP request to the server.
2) The server-side ASP.NET page processes it and responds.
3) The client-side logic receives the response and updates the web page, or whatever.
Swap out each part with something simpler and diagnostic to see where in the pipeline the break is.
For example, create a diagnostic webpage that's a substitue for #1 that calls the server-side page directly.
If that seems to work, create a different server-side ASP.NET page that's very simple, just logs something, to prove that the real #1 does what your diagnostic #1 did.
Ya know, your standard debugging binary search...

Resources