Unexplained Performance Drop Resulting In HTTP 413?
May 11, 2010
I was trying to tweak the web.config file for a web app my company uses to both improve the file's legibility as well as tweak performance and strictness of compilation and ended up making my normally wonderfully-running web app (seemingly start ignoring the UpdatePanels on the page, but mainly) start instantly showing this error upon clicking any web control:The page was not displayed because the request entity is too large.I searched on Google and now know this is an HTTP 413 error, but I have no idea what part of the web.config file I edited that caused this regression. Need to fix quick, as the site is already in production.
Our site was under Slow HTTP POST DOS attack recently. It's when your server receives a lot of incoming connections and keep them for long time because the sender sends information very slow and server cant serve real users' request - denial of service.
The problem is that I can't drop the HTTP connection in asp.net:
Response.End(), throw new Exception(), even Thread.CurrentThread.Abort()
don't close the connection. It waits while sender sends all the fake data, then answer to it with '500 server error' or something. The slow POST attack still will be successful in this case.
I have a troublesome problem which I'm at a loss to explain. To put it simply, the CPU use is inexplicably high on the web servers in my web farm.I have a large number of users hitting two front-end web servers. 99% of the page loads are Ajax requests and serve a simple JSON-serialized object which the web servers retrieve from a backend using WCF. In the typical case (again, probably 99% of the requests), all the ASPX page is doing is making a WCF call to get this data, serializing it into a JSON string and returning it.
The object is pretty small-- a guid, a couple short strings, a few ints.The non-typical case is the initial page load, which does the same thing (WCF request) but injects the response into different parts of the page using asp:literals.
All three machines (2 web servers, one backend) have the same hardward specs. I would expect the backend to do the majority of the work in this situation, since it's managing all the data, doing the lookups, etc. BUT: the load on the backend is much less than the load on the front ends. The backend is a nice, level 10-20% CPU load. The front ends run an average of 30%, but they're all over the map, sometimes hitting spikes of 100% for 10 seconds and taking 600ms to serve these very simple pages.When I run the front-end in profiler (ANTS), it flags the WCF communication as taking 80% of the CPU time. That's the whole call on the .NET-generated WCF proxy.
WCF Setup: the service is fully parallel. I have instancing set to "single" and concurrency set to "multiple". I opened up the maxConnections and listenBacklog on the service to 256. Under heavy strain (500 requests/s) I see about 75 connections open between both front-end servers and the service, so it's not hitting that wall. I have security set to 'none' all around. Bandwidth use is about 1/20th of the potential (4Mb/s on a 100Mb/s network).
On the client (the web servers), I create a static ChannelFactory for the service. Code to call the service looks like:
service = MyChannelFactory.CreateChannel(); try { service.Call();[code]....
What I don't understand is where all this load on the front end is coming from. What's strange about it is that it's never in the 30%-90% range. It's either in panic mode (100%) or doing OK (30% or less). Given the load on the backend, though, I'd expect both of these machines to be 10% or less. Memory use, handles, etc., all seem reasonable.
To add one more wrinkle: when I log how long it takes to service these calls on the backend, I get times consistently less than 15ms (maybe one or two spikes to 30ms every minute). On the front end, these calls can take up to 1s to return. I guess that could be because of the CPU problems, but it seems off to me. where to look on this kind of thing? I'm running short on things to explore.
Clarification: The WCF service is hosted in a Windows service, and is using a netTcp binding. Also, I have the maxConnections on the client set to 128, FWIW.
I have been messing around with uploading working with and then saving a resulting image.
However at the moment im getting errors in the outputted image, even with very simple code which takes the filebase, puts it into an image object then saves it back out.
Also i would like to know if there is a method in MVC to check the file extension or somehow determine wether it is an image file.
We have used the ajax toolkit auto complete extender in an intranet app which uses Windows authentication. The auto complete uses a static page method in the page code behind to get the results. Even though the page containing the auto complete is authenticated by the server and the asp.net session id set in the cookie, the initial requests from the auto complete result in 401.1 and after few attempts result in a 200. This irritates the users of the app. Also later on there are 401.1 happening intermittently among the various 200 there by affecting the responses.
I have verified these responses by using Microsoft Network Monitor,Fiddler and Firebug. Also these entries are present in IIS logs. I tried to implement the same with a script service but that too gives same issues. Our site has lots of ajax features and controls and everything is working fine, only this issue is there.
I'm reading about the UpdatePanel and how it interacts with controls inside & outside of it.
My understanding is that the usual ASP.Net pipeline takes place when posting from within an UpdatePanel-- Page load etc all fire off as normal-- except when the prerendering stage is reached. In that case the ScriptManager does a final check and only renders those controls within the UpdatePanel and skips the rest. That's my understanding at least.
Sounds good, but for argument's sake let's say I have a TextBox located outside an UpdatePanel. If a postback occurs from within that panel, the TextBox's properties can still be set in the page load method, but those changes will not take effect. (normally; it is possible to postback the entire page from an UpdatePanel)
Is that correct? What happens to that TextBox's ViewState in this instance? Is it updated based on what happened to it in the page load method or is that modification tossed out because it wasn't in the UpdatePanel?
I have article.aspx page that there is some Textboxs and fileupload control and insert when users click on btnInsert their data insert into database below is Behind code
I have developed a website in asp.net framework 2 . This website is being hosted in two different servers without any change in code. My issue is about the performance of these 2 sites. One website is taking much time for inserting datas to the DB (SQL server 2005). 2 websites are having different DB server.
I think the issue is for the DB server. How can we rectify the DB performance while insertion and Is there any other cause for this permance issue?
i want to send a some form entries resulting in a postback to be mailed automatically with my gmail account to the target mail id entered by the user with asp.net - c#?
I am not sure if this is the right forum. I can not find a forum for LINQ.
I am working on an application using LINQ. Application performance is not up to par and my tests show that it is LINQ queries that are slow. I was wondering if anybody can recommend where I can find an article about optimizing LINQ performance maybe by compilation or other methods.
I need to run a select statement on log in event and store the value of the select statement (returning one item) in a session variable.Do I have to u sqldatasource for this.. or is there someway I can run a single select statement and store the resulting value in a variable?
I am creating a service oriented application where trying to have everything using services....however there is something I am not sure of , I am having a page that calls the database at the page load...so what would be better and faster?? to call database in pageload , or to call wcf service from javascript during javascript load ??btw , I am using a repeater in the page , but I have created somekind of an engine to create the suitable html so...I'll be creating the repeaters html using the wcf and resend it back to the page If I am using a wcf service at the start.
When I use WatiN to go to a specific web page, how can I fake the HTTP referrer with a query string (i.e. request is from google search with query string q=search_term)? So I can verify that the response header has the 301 redirect for specific referrer URL.
i redirect a page from http to https using http module begin request handler .i am calling webservice using ajax but it is saying webserice not defined .which otherwise works fineits work fine when rediect page in page_load instead .but i need to add function for https to http in every page. i still not know why ajax is not working when i use http module for redirect
I am having problem redirecting error when error is http 500 or http 403 locally running this site there is no problem it gets redirected to my errorpage.aspx. But when deployed at server, it does not get .tried putting try and catch in page_load and in global.asax and I have set Application_Error to redirect to that page and also set <customErrors defaultRedirect to that page also
How can I have 2 Cascading Drop Down Lists for the same Drop Down List?here is my problemi have 3 drop down lists read from database1- Schools List 2- Classes List3- Teachers ListEvery School will have more than 1 Class and more than 1 TeacherWhat I want is when user select a School from Schools Drop Down List then BOTH (Classes and Teachers) should be refreshed based on the School Drop Down List
We are using the Facebook API and receive back URLs for profile image thumbnails. Unfortunately the protocol is restricted to just HTTP and it doesn't support HTTPS. The page on our site that hosts the thumbnails is always delivered via HTTPS, and if we use HTTP for the thumbnails the user will receive security warnings from their browser.
Solution:
Build an HTTP Handler that "passes through" the image from the Facebook URL, but allow the handler to be called via HTTPS. Before I started coding I thought I could something like this:
but I ended up having to save the image to an object in memory than write the image to the Response.OutputStream using the image save function.
Current Code:
[Code]....
This seems inefficient but I can't find a way of using the HTTP Handler as I orginally intended. Is there way of accomplishing the goal without creating the image memory and just "passing through" the call?
I have a drop down list that has the initials of about 12 of our sales guys.How can I make it so that when they select their initials from the list, the next drop down list only shows their customers.In my database there is a column for customer name and salesman.
what is doffrence between http://domain.com & http://www.domain.com where domain is the same name in both of this.e.g. http://mycompany.com & http://www.mycompany.comi
I am working on an ASP.NET 3.5, C#, ASP.NET AJAX, JQUERY web application which currently is having some performance issues. I have a screen with the forms view control and when I edit the form and save it for the first time the POST takes 4.89 seconds and when I perform the same operation again for the second time the POST only takes 1.09 seconds. What could be the reason for this strange behavior?
Note: I am using firebug and I am disregarding the page resources (like js, images) load time.
EDIT: I am using the Web Deployment Project to precompile the application.