C# - WebRequests Are Slow (taking 4 Seconds) - Speed Them Up?
Mar 4, 2010
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:
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?
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.
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:
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.
I am making some application in asp.net 1.1 in that I am displaying data in datagrid from database. In data grid first column is of check box and radio button and in the last column we have text box now thing is that when i click on check box crosponding textbox we fill some figure and at the end we press calculate button to get total. After getting total we have to press continue button to go next step
But suppose if some body remove that check the we should press calculate button or chnage some figure in the text box then we should press calculate button again to recalculate. for that i kept autopost back on check box oncheckedchanged event and text box ontextchanged event and hide continue button so user will click calcutae button abd then continue button will re-apper
Problem it that it taking too much refresh and taking long time. So was lloking for some ajax method to use in my application.
I have a file upload to SQL Server 2005 DB that keeps timeing out at different times. I know about the web.config <httpRuntime maxRequestLength="2097151" executionTimeout="180"/> Where else are there times out settings?
I am creating a small testharness which will create load on the website with multiple threads. All I doing is
But this keeps timing out after few request. I have looked into the IIS worker process requests and I can see the requests being in there in the state of sendresponce. If I request the same url from my browser the reponce is there. Am I doing something wrong here?
I am writing an 3-tier enterprise asp.net web application which needs to be very lightweigt to lower the bandwidth usage. I want to speed up ASP.NET web page loading, I have minified all js and css, used AJAX, used less images in page, used paging for grids but still the overall response page size goes to nearly 1Mb because of viewstate hidden fields.
im developing some backends in ASP.NET 2.0 and i have put all the images in Cache, GZIPED my CSS, JS files and everything to speedup the load of each options.
the performance its good and i have no problems with the clients but i want "MORE" fast loads and im looking for some recomendations.
Is important to mention that those websites are using only in intranets so im thinking to implement my next projects using IFRAME for content that way (i think) the options will be loading faster because they not have to load the entire site.
im not using viewstates i wrote HTML (code behing) generated controls and use as less as possible ASP.NET Rich controls, all my static contents are in Static vars (Header, Menu, Footer) but im just looking for speed up a litter more.
After compile my website i compress all the HTML, CSS, JS and use less of those files as possible.
but i was seeying others Backend that loads faster than my and the difference is the IFrame control that they use (i think), we check code, design, etc and we use the same (they use #INCLUDES for static HTML instead STATIC VARS with the HTML)
Is there a way to measure the time elapsed for a web page to execute?
And if so, is it safe to use that figure to estimate the speed of the web page as the number of users grow and the database grows. Ie: if the page currently takes 1 second to process through x amount of rows in the database, to estimate it would take 2 seconds with 2x rows?
I have a web application running on ASP.NET 3.5 which basically stores, retrieves, and allows users to manipulate data from a SQL Server 2005 database. One of the features allows users to search through the records in the database. When the system was first launched last year, there were no records, so searches were lightning fast. However, over the past year, about 100,000 records have been entered, so most searches now take over 15 seconds to perform. I'd like to speed up searches, but there are problems with both of the conventional approaches I can think of:
Caching - The database does all the heavy lifting in this application - the ASP.NET web application is little more than a UI that passes user input to the correct stored procedure, and displays the returned output. The stored procedures are responsible for interpreting user input, applying the business rules, and transforming the underlying tables and views into a context-sensitive result set which the application just displays as is. Unless if there's a way to apply a stored procedure to a C# object/collection (the cached records), and get another C# object/collection back, effectively bypassing the database, I don't think this will work.Stored procedure optimization - There's some optimization potential here, but even a simple SELECT * FROM TheView statement on the underlying view currently takes 11 seconds according to SSMS, and I expect that the amount of time taken will continue to increase as more records are entered.Are there are techniques out there that I'm not aware of, which could be used to bring searching down to a reasonable amount of time (5 seconds or less per search)?
When I browse the asp.net pages on local host, only IE renders pages very fast. In every other browser I have a delay of 1 second or so. Why is that happening and is there any way to speed up the response time in other browsers (web.config, IIS setting)?
I have a requirement where i want compare only the date part of a DateTime Object not the seconds with the another object.I tried if(DateTime.Compare(dt1, dt2) == 0) where it compares both date and seconds, but i want only date part.
I am converting my datetime object with current date and specific time 23:59:59 as shown underneath.
But when I check in my sql table datetime column, it is changes seconds part of time from 59 to 00, so for instance, if I have a datetime, 2010-08-11 23:59:59, it changes this to 2010-08-11 23:59:00. How should I fix this.
I have a page called HP.aspx that has an iframe to display a presentation made up of several pages. On the last page (Movie.aspx) within the HP.aspx iframe, I want to redirect the page to Projects.aspx outside the HP.aspx iframe after 25 seconds.
I know I can use 'Response.Write("<script>window.open('~/Projects.aspx','_top');</script>");' in the Movie.aspx's codebehind to redirect the page outside the iframe, but how do I set the page load to redirect after 25 seconds.
I' know the usual way of redirect after a specific time in C# is 'Response.AddHeader("REFRESH", "25;URL=~/Projects.aspx");,' but that leaves me still within the HP.aspx iframe. I tried replaces '~/Projects.aspx' withe '<script>...</script>' but it just gave me an error still inside the HP.aspx iframe.
I'm currently using ASP.net. I wonder what would I need to do to let the browser wait for 3 seconds so my users can read the text "Customer Successfully Added" before turning to another page? I have attached my code as follows.
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click Dim db As New DatabaseClass db.addProfile(txtLN.Text, txtFN.Text, txtUsername.Text, txtPassword.Text, txtAddress.Text, txtZip.Text, txtPhone.Text, txtEmail.Text) lblMessage.Text = "Customer Successfully Added" End Sub
In addition, I'm not sure how to utilize MSDN. For me, its information overload, I'm wondering how to go about finding the solution on MSDN so i would be able to solve my problems in the future.
I going to developed website that ping domain in every some time interval for checking the domain status. refer site: http://pingdom.com/ this site also like do same. How I get Ping statistic using C#..?