Web Forms :: When Published And As Well As During Development, The Execution Speed Of Page Is Very Slow?
Apr 21, 2010
i have developed an ERP in asp.net 3.5. The problem is that when published and as well as during development, the execution speed of page is very slow. I have off the compilation mode in web.config and also get all the data in page load and then filter it using Dataview rowfilter property but i can't get much better speed.
i see that my site is a little slow in my localhost it is fast but in the server not but i see that videos are displayed without problems so i dont think that is from bandwith but i am not sure which are the main things that make a page go slow? sessions can be one of that?? or connections with database??or something else?
Over the last week I've been investigating an issue for one of our clients whereby the initial page load following a deployment of their website takes around 1 minute, resulting in unacceptable downtime for end users. This was happening not only for code deplyments (bin dll's and .config files) but also if there were large numbers of .aspx pages updated. For code deployments it's not an issue, but for aspx updates it is; in this particular scenario, we are making use of a 3rd party content management system (RedDot from OpenText) in which every page of the site is published out as a distinct .aspx page. This means that for this website there's somewhere in the region of 2,400 separate .aspx pages. I realise this isn't an ideal situation but we're working within the constraints of the CMS, and we managed to correlate the instances where the site was unresponsive with App pool restarts, which also corresponded to publications of of .aspx pages.
I found an article by Tess Ferandez [URL] which describes all the reasons why the app pool may restart, and it does seem that if more than 15 .aspx pages are changed then the app pool will recycle and the pages will be re-compiled. Another msdn article [URL] then gave me a few pointers on how to start addressing this problem, and for the moment I've set a flag on the compilation options to prevent batch compilation:
<compilation batch="false">
This means that the initial page load now takes around 6 seconds instead of 1 minute, which is a great improvement. However, I also used the "Compilations Total" performance counter to investigate the number of pages that have been compiled by ASP.NET for my site and was quite surprised that the total number of pages that get compiled peaks at 44, which is odd given that there are 2,400 aspx pages in the site. If the batch flag is set to false, the counter slowly increments by 1 page at a time as you click around on the site; if batch mode is true, the initial compilation takes the number straight to 44 over the course of ~60 seconds. What I'm really struggling to understand is why all 2,400 pages aren't compiled. Does anyone have any inside info on what might be going on as all the documentation I've read seems to indicate that all of the pages should be compiled and this counter should be much higher.
My application runs quickly when debugging locally, but slows down to an almost unusable state once published. Oddly, the published version seems to be grabbing data very quickly from MSSQL - it's the part where I'm updating datatables and gridviews that is very slow. For example:
I'm doing a web request that is too slow. It takes around 3.2 seconds to GetResponseStream() and .8 seconds to ReadToEnd() If I run the same request in a web browser I get a response in less than a second... I'm wondering what I can do to speed up the request and what might cause it to be slow? Based on other questions I saw here, I disabled the proxy in app.config + enabled max connections, just in case (it's still slow). The section I added was:
This might be a pretty strange question in the eyes of some of you out here, but I really wonder if comments in my code will slow down the execution time of the pages I make.I have some Classes / WebControls that required alot of comments to make everything clear and quickly readable to other people that will have to deal with my code and now wonder how ASP.Net deals with my comments. Will comments be stripped from my code at compile time or how is this all done?I should be more specific: I mean comments in my code-behind in C#.
I know it's not the best practice to do, but unfortunately I created a page with multiple large dropdown lists and have them inside an ajax updatepanel. I found some work arounds using siderite's ajax updatepanel adapter: http://fastlistadapter.codeplex.com/.
The performance is very good while I am debugging on my machine, but when I publish the site and post it to a win 2003 server the performance drops off almost as bad as when the fix isn't there.
I understand that using a 3rd party fix really isn't supported by most, but is there any obvious reason why debug performance would be much better than published site performance on the same exact code?
I have developed an application that interacts with IBM ClearQuest. The problem is that when I run everything locally, such as, run the webservice local and then ASP page local everything is at the speed I expect. When I post the webservice (precompiled) to the server and run the web page through the server, the call to the webmethod takes at least 10x the amount of time it should. I dont know why this is happening. I made a console application that has the function in question and execute it on the server and locally and they both return the same amounts of time (roughly) its just when I move to executing via the webmethod everything grinds to a snails pace. Any ideas? This happens every time not just on the first call.
WebMethod:
Public Function RetrieveQueryResults(ByRef cqSession As ClearQuestOleServer.Session, _ ByVal sqlStmt As String) As List(Of SearchResultsSingleIssue) Dim numCols As Integer, status As Integer, columnIdx As Integer Dim numRows As Integer Dim rowContents As String = "" Dim colValue As New Object Dim colLabel As New Object Dim allitems As New List(Of SearchResultsSingleIssue) Dim results As New SearchResultsSingleIssue Dim cqResultSet As ClearQuestOleServer.OAdResultset cqResultSet = cqSession.BuildSQLQuery(sqlStmt) cqResultSet.Execute() ' Get the number of columns returned by the query. numRows = 0 numCols = cqResultSet.GetNumberOfColumns status = cqResultSet.MoveNext ' Collect query results. Do While status = AD_SUCCESS results = New SearchResultsSingleIssue numRows = numRows + 1 For columnIdx = 1 To numCols colLabel = cqResultSet.GetColumnLabel(columnIdx) colValue = cqResultSet.GetColumnValue(columnIdx) 'Make sure that we dont pass along a null reference If colValue = Nothing Then colValue = "" End If Select Case colLabel Case "ID" results.IssueID = colValue Case "HEADLINE" results.Headline = colValue Case "NAME" results.State = colValue Case "OE_CONTACT" results.OEContact = colValue Case "DESCRIPTION" results.Further_Description = colValue Case "PRODUCT_NAME" results.Product_Name = colValue Case "FUNCTIONAL_AREA" results.Functional_Area = colValue Case "SUBTOPIC" results.Subtopic = colValue Case "FOUND_VERSION" results.Found_In = colValue Case "SCHEDULED_VERSION" results.Scheduled_For = colValue Case "SYMPTOMS" results.Symptoms = colValue Case "AFFECTED_SYSTEMS" results.Affected_System_Types = colValue Case "ISSUE_TYPE" results.Issue_Type = colValue Case "ASSIGNED_TO" results.Assigned_Developer = colValue Case "TESTED_BY" results.Assigned_Tester = colValue Case "BUILT_VERSION" results.Built_In = colValue Case "TESTED_VERSION" results.Tested_In = colValue Case "NOTES_LOG" results.Notes_Log = colValue Case "CUSTOMER_SEVERITY" results.Severity = colValue Case "PRIORITY" results.Priority = colValue End Select Next columnIdx ' Add the query row result to the compiled list of all rows. allitems.Add(results) status = cqResultSet.MoveNext Loop Return allitems End Function
Debugging using the ASP.NET Development server is extremely slow to initialize. The behavior I'm getting is that if I launch the DevServer from VS2008, the first attempt to load a page takes minutes. After that, it's fine. Before the first page load, the DevServer UI responds to input normally (I can bring it up from the status area, use its context menu, and move the window around) until the first page load comes in. Then it shows the busy cursor (spinning blue ring) for 2-6 minutes before finally completing. There is no significant processor or I/O activity during this. After that, it runs normal speed, quite fast.
Using VisualWebDeveloper 2010 on the development machine. All nice and fast.Using VisualWebDeveloper 2008 on the server. Server runs on Windows Server 2008 and has IIS 7.
It looks like that when 'table', a datatabe filled up in C# code behind, is getting longer, then the server (whether running the website on IIS or on the local host of VIsualWebDeveloper2008) is really slowing down. Checked it in debug mode and traced it down to
Adapter.Update(table);
Are there any know issues? Could it be that there is incompatibility between different version of SQL server or something like that? The update works, it is just awefully slow, but only on the server.
Have a look at this link.Web pageIf I want to have this kind of speed in my page load which consists of many thumbnail images. It that image is stored in database or in file system.What measures to take to achive this kind of speed like indexing, denormalization, caching and what else?
I am trying to add some code that logs to a table the time a page has taken to generate, from the request coming in to the response given back. The easiest way to do this is through our master page as it can add the timings of every page.Where I'm a little unsure, is when to put the start and end timings.Currently, I set the start time in the page.unload and the end time as the last part of the page.load on the master page.The figures coming back seem ok, but I'm not sure if I am picking the earliest and latest possible times to get my timings?
I've developed a web page Client.aspx that is used for editing a client. This application has been deployed and I made sure that debug='false'.Upon selecting a client from the dropdownlist, his/her information is retrieved for editing. This retrieving process is very slow( about 9 seconds).Except this DropDownList, all the other controls on this page are within the Update Panel. There are 2-3 other Update Panels within the main Update Panel.
When a client is selected from the DropDownList, the Client_ID (DataValueField) is used to retrive the informationSELECT * FROM CLIENTS WHERE Client_ID=1576 This method returns a dataset.In the calling method I'm assigning these values to the respective fields.Some JavaScript is used for validating Phone#.I also have a RadioButtonList on this page. When one of the ListItem is selected I need to disable a TextBox. Even this process is taking much time than expected.
Dim cmsManager As New Telerik.Cms.CmsManager() Dim currentNode As Telerik.Cms.Web.CmsSiteMapNode = CType(SiteMap.CurrentNode, Telerik.Cms.Web.CmsSiteMapNode) Dim currentPage As Telerik.Cms.ICmsPage = currentNode.GetCmsPage() Dim currentPageId As Guid = currentPage.ID Dim pageFromDb As Telerik.Cms.IPage = cmsManager.GetPage(currentPageId) Me.LastUpdateDate = pageFromDb.DateModified
Unfortunately .DateModified returns the last time that a page was edited instead of when it was last published.
I would like to speed up the loading of this page. But at the same time make sure that it don't slow down performance of other parts of web application and also do not crash the IIS.
The are several approaches:
Use AJAX requests. Needs to be MVC style requests to Controller or Web Service. Using UpdatePanel around each section will not work - since if I try to submit refreshes to multiple UpdatePanels at the same time using approach here: [URL], the last request will always win: [URL] Use ASP.NET threads described in answer to right way to create thread in ASP.NET web application. So I would use a separate thread for each call: RenderSection1, RenderSection2, etc... Move the logic that takes up time, usually DB requests, into Application Service class in another DLL or External Web Service. Something like
OrderDTO GetDataForViewOrder(int orderID) { }
and use multiple threads in that DLL. This approach seems to provide the best scalability, but also introduces UI details into Application Services layer.
I have a textbox that I need to make sure the case is right. I am using the code below but it is very slow, plus when I close my web page I get an error.
I have two webforms for different performance.If the slow web form with several dropdownlist with 10000 items from database, it will be delay when typing some letters in the textbox.But when typing letters in the fast webform with dropdownlist with 5 items from database, it will be no delay when typing some letters in the textbox
I've been using things like Firebug and YSlow, so I'm not really looking for advice on increasing page load speeds, but I'm wondering does extra imports or using, especially if your importing or using classes that aren't necessary, cause a page to load slower?
I need to build a page to test online video speed.
video will be uploaded in my webserver and there is no flash play in the server. I need to have two players. one is window media player, second is a flashplayer (prefer using google player)
Page layout:
Windows media player
report of speed testing
Flash player
report of speed testing
report requirement
1.length of video
2. total time that spend to load this video (dynamic is better)
3. average download and upload speed during playing the video
(I believe that this applies to both normal ASP.NET web parts and SharePoint hosted web parts)
The web part has an 'export' button that renders the output as csv and sets the appropriate headers so its opened in Excel.
Hooking in the buttons click event, clearing the response, adding the appropriate headers and content types is trivial - example
However I've noticed that if this code added to a web part and a debugger attached then if there are multiple instances of this (or any other) web part on the page then neither HTTPApplication.CompleteRequest or Response.End stop the processing/page lifecycle and all the events for all the page controls still fire.
This is wasteful in this example as the other web parts don't need to run - nothing they do will get to the response.
I am using gridview. In which i m entering some value in textbox in Gridview.According to that value, i m generating datatable and binding it to the Gridview(Child Gridview).But when i m doing this, the performance of the page is very slow. How do i improve the performance.