-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SignalR Hub - Hub performance degredation in IE #2456
Comments
Can you send us a repro? |
Will work on it in the morning. Thanks :) Sent from my Virgin Mobile phone -------- Original message -------- Can you send us a repro? — This email, along with any attachments, may be considered confidential and/or proprietary. If you have received it in error, you are on notice of its status. Please notify me immediately by reply email and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. Thank you for your cooperation. |
Here is a sample project that shows the performance issue: https://drive.google.com/folderview?id=0B5k8a6Y1R74gR0tGLVZXZVE5N28&usp=sharing Cheers. |
Thanks for the project. I'm looking at the page and the instructions but I'm not sure what the expectation is? Am I supposed to see IE freeze? |
IE won't freeze, but if you monitor the trace logs, you can see that it takes a long time to process the joins. Here is the trace log using void. Everything happens within a second.
Everything happens pretty quickly. Here it is with Task. Takes over 30 seconds.
If I run the Task version with chrome, its back to one second:
|
Firstly, it's nothing to do with IE, it's a longpolling issue. If you specify longpolling chrome behaves the same as IE. I'm not seeing a performance fail from looking at the network monitor and fiddler, it looks like requests are getting queue in such a way that it's making group acks fail. Here's the problem: Long polling has 1 long running request and uses ajax posts to send data to mimic a socket. What's happening is that invoking server methods back to back are causing them to get queued up before the new long polling request. When this happens, each of requests hang for 30 seconds waiting for a reply from the client (to confirm it is indeed in the group). Here's a visual in fiddler: In the above picture, the /connect request (the first long polling request) ends and when trying to poll again, there's several /send requests that are waiting on a reply (the Groups.Add task). That reply will never happen because there's no new /poll request. This is a pretty awesome bug 😄. |
- The manager is used to control how many active ajax requests happen at the same time. - Defaulted the max allows to 4, this allows for 1 poll long polling request and 1 long running user request. - Ensured that all deferred ajax requests still fire in order. #2456
- One test ensures that the ajaxManager dispatches deferred ajax requests in the order that they were executed. - Next ensures that even when a lot of "send" requests are executed synchronously that we don't deadlock. #2456
This is certainly interesting. A thought: another way to approach this would be to return from the Task returning hub methods immediately, with a hub result indicating a pending result. That would end the ajax request very quickly then (like void returning methods). When the Task completes the result could be sent via the bus rather than piggy backing on the original ajax request response. This would only be done for Task returning methods. |
…equest completes. - Also added a maxConcurrentSends function to signalR.transports to allow configuration of the ajaxManager. #2456
…tly monkey patch it. - This did not matter before because we never relied on the return value within the SignalR layer (now we do). - Also found that joining too many groups resulted in us quickly going over our URL limit of the browser, therefore decreased some of the request thresholds of tests that stress how many ajax requests can be made. #2456
Marking as blocked until we implement the secondary method and compare. |
We'll move this to the new repo as a candidate for v3 or beyond. |
I have a severe, logarithmic performance degradation in IE (not Chrome or Fixfox) when returning a Task after using Groups.Add.
E.g. the following method starts to break down after 7 or 8 calls (at 10, it takes longer than I am willing to wait).
If, however, I replace it with a void method, it works fine (kind of, still measurably slower than Chrome/FireFox):
Note that these are fired, and then more SignalR stuff is called. Client code is similar to the following:
This is happening in IE 10 and IE 10 running in IE 9 mode.
Note that this was tested using V1.1.3.
The text was updated successfully, but these errors were encountered: