I have a web application that is hosted on an embedded device. This device has its own basic web server that can serve content just like any other web server.

The web application in question is pretty data hungry. It requests about 15 XML files (usually less than 1kb) every few seconds to update a wide variety of modules on the application page. This is done with jquery / ajax. Each module has an independent timer to update itself, usually every 5-10 seconds, so often these timers align and requests are done in bursts.

In long term tests, the web application begins to fail. Within a few hours, requests begin to fail, not due to timeouts, but due to web connection resets. Using Wireshark, it is evident that it is the browser requesting to reset the connection. I am able to look directly into the web server, and there are no errors/timeouts/resets/etc from the server end. It is directly the browser deciding to reset the connection.

I am in no way asking the browser to do this. My application is basic and is simply requesting data endlessly. I can't think of any reason for the browser itself to decide to reset the connection on its own. This occurs in firefox and chrome. My only suspects are myself and jQuery's AJAX.

Any ideas are appreciated.

  • 1
    As far as I know there is a hard limit of concurrent connections at any time (6 for most browsers last time I checked). Did you try to queue the requests and handle the next one only if the last one has finished? A brutal and bad way to do this would be to use async: false, this would block the browser and totally fail if there is any server side problem. But for testing it may give you some idea what's going on. – thorsten müller Feb 1 '16 at 14:25
  • This sounds right - where can I read about this limit? I guess I need a queue... – BarryBones41 Feb 1 '16 at 14:33
  • 1
  • Thank you. Which field am I concerned with? Connections per hostname or Max connections? Final question - is a javascript/css or other external request considered a concurrent connection? If my page requests, as an extreme example, 30 javascript files, are these handled synchronously? – BarryBones41 Feb 1 '16 at 14:43
  • 1
    It's connections per hostname since all go to the same server. Not 100% sure about the javascript on page load but as far as I know this is limited the same way. Merging files into one single file (or as few as possible) is often recommended to increase load speed. (also moving files to a CDN can help since this would be a different host) – thorsten müller Feb 1 '16 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.