I've been following performance of my website and out of all slow-executing code (>1s), more than 90% is because of System.Web.HttpRequest.GetEntireRawContent() (called by System.Web.HttpRequest.FillInFormCollection())
Is this normal for ASP.NET sites... to sometimes spend more than 10 seconds in FillInFormCollection method (obviously it's called from System.Web.UI.Page.PerformPreInit())?
Or there is a way to fix this problem?
I'm compiling for .NET Framework 3.5.
Page I'm mostly having trouble is Login page, although there is nothing unusual about it - two TextBoxes, Checkbox for RememberLogin and Login button. Request.ContentLength is around 5KB (I've logged Request.Form.ToString() - found nothing unusual). I've performed lots of tracing (were expecting huge POSTs) and debugging but couldn't find any rational reason for FillInFormCollection to take more than 10 seconds (I once had extreme example with 250 seconds). I've even tried slowing down my connection with Fiddler, but couldn't reproduce the problem.
EDIT: Thanks for all the comments guys. I've continued pursuing this issue... if it gets solved at least it'll save other people quite some time ;). Here are answers to some of the questions.
- It's plain HTTP (not HTTPS), 0 errors in Log (funny thing is that requests actually get completed ;)
- Site is not being loaded when user hits Login.aspx. Site is actually working pretty good 99% of the time (handles around 40 million HTTP requests per week with AVG CPU utilization below 10%)
- It's definitely application/x-www-form-urlencoded - ASP.NET Forms (runat=server) get submitted that way. The only thing I don't understand is why .NET needs >10 seconds to read POST that's less than 6KB.
- The only rational conclusion I came up with (so far) is -> customers accessing site from really slow connections (remember GPRS?). But I would really like to explore all other options rather than just resort to "it's user connection". And if that was the case - I expect I would be seeing similar thing happening for user on every page.
- Just hoping it's not something like this: IIS 6.0 Server Too Busy HTTP 503 Connection_Dropped DefaultAppPool
- Got referred to this page: Identifying Slow HTTP Attack Vulnerabilities on Web Applications It is possible that this is happening.
HttpRequest
object doesn't have such a method (see here). Is it an extension method? – Complement