diff options
author | tyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 04:02:02 +0000 |
---|---|---|
committer | tyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 04:02:02 +0000 |
commit | c33716931d8f130cc04f1308184284200131d6a4 (patch) | |
tree | 1f646ce2a348cc72bb2db6071642a6c44f596638 /net/base | |
parent | 26bfe9ee57f6dc2a31fe888f4b6f8d8c2408750d (diff) | |
download | chromium_src-c33716931d8f130cc04f1308184284200131d6a4.zip chromium_src-c33716931d8f130cc04f1308184284200131d6a4.tar.gz chromium_src-c33716931d8f130cc04f1308184284200131d6a4.tar.bz2 |
Reduce 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
Review URL: https://chromiumcodereview.appspot.com/18932005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212235 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/net_error_list.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h index 234b3a9..5ec421e 100644 --- a/net/base/net_error_list.h +++ b/net/base/net_error_list.h @@ -292,6 +292,14 @@ NET_ERROR(ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH, -152) // ServerKeyExchange) or validate a Finished message. NET_ERROR(SSL_DECRYPT_ERROR_ALERT, -153) +// There are too many pending WebSocketJob instances, so the new job was not +// pushed to the queue. +NET_ERROR(WS_THROTTLE_QUEUE_TOO_LARGE, -154) + +// There are too many active SocketStream instances, so the new connect request +// was rejected. +NET_ERROR(TOO_MANY_SOCKET_STREAMS, -155) + // Certificate error codes // // The values of certificate error codes must be consecutive. |