1

My IIS webserver freezes, when i open multiple tabs on firefox/chrome/etc. Im not sure, what it is. I think i have a problem with my SQL Server, though i`m using javascript to get live-data directly from the database. My Javascript fills in a span a value. The value is loaded from an external asp.net file. The asp file loads the vaule from my sql database.

The freeze looks like this: When one tab is opened i can use the page as i want. I can choose data from a table, open the data and read a life-value 8Or better, multiple live values).

When i open another tab, the page starts loading very long. sometimes the page can be loaded, but after a few moments the other page crashes with the live data and after that nothing can be loaded again. then i need to restart the complete iis service.

I checked every sql query, to open the connection, use the reader, close the reader and close the connection again (Check code).

I programmed a work-around, which is not working anymore, i dont know why. it restarts via batch every 5 seconds the website (not the service, though its taking to long and the pages stop connecting).

I use now jquery for live-data, though pure js was not working correctly.

I reinstalled the iis service, with all components.

I reconfigured the website which is running on my IIS.

This is a sample request-answer from the asp file, which will be loaded from the js for live-data

//Wir benötigen die Artikelnummer
if (Request.QueryString["artikelnr"] != null)
 {
  DBMaster dbm = new DBMaster();
  string return_text = "X2";

  string query = "SELECT * FROM artikel WHERE artikelnr LIKE '" + Request.QueryString["artikelnr"].ToString() + "' AND beendet LIKE '0'";

try
 {
  SqlDataReader artikel = dbm.get_data(query);
  //Zähle die Zahlen hoch für Sollmenge
  while (artikel.Read())
   {
    sollmenge += Int32.Parse(artikel["sollmenge"].ToString());
   }
  return_text = sollmenge.ToString() + " St.";
  artikel.Close();
  //Datenbankverbindung schließen
  dbm.close_connect();
  }
  catch (Exception ex)
  {
   //Wir geben eine Leere antwort, falls wir keine Daten gefunden haben.
   return_text = "Failed: X1";
  }
  lit_api_answer.Text = return_text;
  }

This is the js for live data

<script>
 //Globale Funktion ohne angabe von IDs oder Stationsnummern
 function get_global_data(type, gdata) { $(gdata).load('api_call.aspx?type=' + type, function () { }); }
 setInterval(function () {
 get_global_data('get_nothalt', '#gnothalt')
 }, 2000);
 </script>

the span, which will be filled with the live-data

<span id="gnothalt">
</span>

I hope, that its only the code. but if you like, you can give other information, like - the OS is a modified version from beckhoff. I cant see the service running.

huntr
  • 11
  • 1
  • Im getting nearer to the cause. I was clicking and clicking and opened multiple tabs. It was working normal for a few minutes. I opened another interface and it imedeatly stopped working. Everything froze and i got this error on one page: "an-object-reference-not-set-to-an-instance-of-an-object-error-occu" There was a "NullReferenceException" in one of the files. – huntr Apr 29 '19 at 09:44
  • And this is what the IIS log shows at this moment: #Date: 2019-04-29 09:18:21 #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken 2019-04-29 09:18:21 10.16.6.71 GET /planer_main.aspx - 80 - 10.16.6.71 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:66.0)+Gecko/20100101+Firefox/66.0 - 500 0 0 1982 – huntr Apr 29 '19 at 09:45
  • Okay now im experiencing something with sessions. my session gives null back. System.Web.SessionState.HttpSessionState.this[string].get gave 'null' back. – huntr Apr 29 '19 at 13:36
  • i think i found the issue. i`ve checked a user session for NULL and a value. now im only checking it for NULL, and it looks like its working. – huntr Apr 29 '19 at 14:22
  • The aspx page that you use as a service, is it using the `Session` in any way? Reason for the question is that `Asp.Net` serializes access to a specific session, meaning if two request are trying to access the same session at the same time, one of them will be blocked until the other is finished. If you have many windows open with the same session, polling every 2 seconds, then eventually these polling request will start blocking each other... – user1429080 Apr 30 '19 at 12:21
  • Hello, yes im only using sessions with user login. there is an administration back panel, that can only be accessed if the session ist set. – huntr May 10 '19 at 08:56
  • But do you need to access the `Session` in the `api_call.aspx` page? If not, you can add `EnableSessionState="false"` in the page directive after which the *one concurrent request per session* will no longer be an issue for this page. If you need to read the session, but not write to it, you can use `EnableSessionState="ReadOnly"`. – user1429080 May 10 '19 at 11:26

0 Answers0