0

Currently I'm working on a ASP.NET MVC webapp which implemented a user dashboard where the user can add various charts to display data. We're using AngularJS for the client side to send the requests for data to a WebAPI solution. The WebAPI action that returns the data is implemented as async - however, in the action we're querying some rather big Sql Server DB and apply various filters that the clients sets. In case the user has more charts (10+) and he's "hitting" a big data set the Action on the WebAPI can take a bit of time to process.

My issue is that in Firebug I see all the GET requests being sent by AngularJS to the WebAPI, some of them (2-3) start being processed immediately, but the rest seems to get queued and in Firebug once they are finally processed I see that the Connecting time for them is huge.

Can anyone give me any idea and make understand why WebAPI doesn't seem to respond to all the requests immediately? What am I missing? Are there any settings that I could apply to improve the performance on the WebAPI?

Thank you in advance for any suggestions!

Andrei

AndreiC
  • 1,490
  • 4
  • 16
  • 34
  • Show us some code! Can't really help otherwise.... – Alex Mar 27 '15 at 16:32
  • 1
    Look at the following post for some clues: http://stackoverflow.com/questions/11185618/whats-the-maximum-number-of-simultaneous-connections-a-browser-will-make – David Tansey Mar 27 '15 at 16:37
  • @Alex it would be way too much code to show... plus as already mentioned, the code works (from a functional point of view) - if the data set on which the charts are created is small everything works fine... – AndreiC Mar 27 '15 at 16:41
  • @DavidTansey thank you for the link... will take a look and hope to find some clues – AndreiC Mar 27 '15 at 16:43
  • assuming you're using async/await properly on the server side and not running out of threads, it's the browser limit on the number of connections, as per link already shared – Alex Mar 27 '15 at 16:46
  • @Alex I believe my async/await is working fine on the webapi as I placed some logging on the webapi and I can see the first requests being parallel... the others just don't come. So yes, the link provided by David seems to be a good direction of study for my problem. I'm considering implementing batch request on the webapi for this specific scenario. – AndreiC Mar 27 '15 at 16:58
  • since you can't / won't post cut down version of your code, we can't help you there - but when it's "blocked" try it from another browser, and see if it's ok - that will prove / disprove this theory – Alex Mar 27 '15 at 17:00
  • @Alex I've tested it with 3 browsers in paralel (Firefox, Opera and Chrome) and each of them get data, but as described before... so indeed it seems to be a browser connections limit problem. Will investigate more and revert here with some stripped version of my code in case I'll suspect something fishy there... Thank you! – AndreiC Mar 27 '15 at 17:14

0 Answers0