DescriptionReduce the complexity of WebSocketThrottle's wakeup code
Currently, job removing code and wakeup code are separate.
With the wait queue algorithm employed by WakeupSocketIfNecessary, we
have O(N^2 log N) total complexity for shutting down all pending jobs.
So, it can make IO thread busy for long time. To prevent such situation
occurring for bogus web app,
- integrate wakeup code into job removing code so that we can build a
list of wakeup candidates from removing process and check only jobs
in it. Total complexity for shutdown will then be O(N log N)
- have some reasonable limit for the maximum number of WebSocketJob
instances pending in the WebSocketThrottle.
The number of WebSocketJob instances pending in WebSocketThrottle will
be limited up to 1k.
Also, the number of active SocketStream instances should be limited.
When huge number of WebSocket instances are created, it pressures the
browser process. It'll be limited up to 16k.
BUG=259005
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=212235
Patch Set 1 #Patch Set 2 : Correct error codes #Patch Set 3 : szym and yhirano's comments #Patch Set 4 : Comment fix #
Total comments: 12
Patch Set 5 : szym and yhirano's comments #Patch Set 6 : Rebase #Patch Set 7 : #Patch Set 8 : android_dbg build fix #
Messages
Total messages: 19 (0 generated)
|