I have a very simple AJAX JavaScript request using jQuery:
$.ajax({
type: "POST",
url: "TabbedSummaryPage.aspx/RunReport",
data: "{'itemId': '', 'lType': '', 'reportId': '', 'requestXml': ''}",
contentType: "application/json",
dataType: "json",
success: function (data, textStatus, jqXHR) {
},
error: function (jqXHR, textStatus, errorThrown) {
},
complete: function (jqXHR, textStatus) {
}
});
Which invokes and executes the following C # code:
[WebMethod]
public static RunReportResponse RunReport(string itemId, string lType, string reportId, string requestXml)
{
var result = new RunReportResponse();
return result;
}
public struct RunReportResponse
{
public string reportTitle;
public string reportError;
public string reportHtml;
public string reportStyles;
public bool showWordMenu;
}
public class Global : System.Web.HttpApplication
{
}
I removed everything so that nothing would be done.
If I make several simultaneous AJAX requests, something strange will happen.
The average time it takes to receive the first byte from a response is about 50 ms if I make 11 requests, but 5 of them always take 2 to 3 seconds to respond with the first byte.
, , , , , 6 3 , 11 5 , , ASP.NET, IIS 1000+ .
, , , .
Internet Explorer 11, Chrome Firefox.
, WebMethod, .
, :
POST /pharmadotnet/Pharma/TabbedSummaryPage.aspx/RunReport HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-GB,en;q=0.7,en-US;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/json; charset=UTF-8
X-Requested-With: XMLHttpReques
Referer: http://localhost/pharmadotnet/Pharma/tabbedsummarypage.aspx?lType=coInfo&itemId=1293&compId=co&reportingCurrency=&sceName=&showTabs=
Content-Length: 223
Cookie: sTab=tabs-1; ASP.NET_SessionId=r01d2eqjxu0vdnexbl5mmd3p; curSessionId=r01d2eqjxu0vdnexbl5mmd3p; NewSession=true; __AntiXsrfToken=ec03abb28ee14f50a18e34216aa59d85; .ASPXUSERDEMO=DF6CD4223C47DB289B82E0240DAB40AAF253BACE9A753863E77BA07F9CEE61D00235255A2BAA58F555ECF3166D8470E77654DB8C3E2594E54B5BAF38A5ACDCCA5FDED79ECD0B89DC3583B4F7E56911C15EE894365CA1444CF0A8D2AB8FEF19AA915CE3989F07DCFE6F4941DA69FBB38593BC51A9
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Tue, 08 Sep 2015 12:50:58 GMT
Content-Length: 174
, .
IIS .
WebForms .
- , ?