My master thesis is based on WebSockets. Today (25th April 2012) I got the new Firefox 12 update (download/release notes/infos for developers). Immediately my application crashed after running it for some time. This post describes my analysis.
The test application
For the experiement, I wrote a simple test application. It opens a WebSocket connection (line 20) and close it as soon it was opened (line 25). If the connection was opened before (line 29), we rerun the test again (line 31). Otherwise we try to rerun it every second (line 34) and print the error code (MDN/RFC 6455). The application can be started and stopped with the buttons.
As a WebSocket server I used the WebSocketServer from the Netty project on Port 9090.
The results
Running the test application in Chrome 20.0.1105.0 dev it gives the following output:
Chrome 20 opened and closed more than 600 WebSocket connections. Even more than 2000 are working well (as expected):
Running the test application in Chromium 18.0.1025.151 it gives the following output:
More than 2800 connections give the same result as before.
Running the test application in Firefox 11 it gives the following output:
As we can see, Firefox 11 opened and closed more than 200 WebSocket connections. Two minutes later, there were almost 1300 WebSocket connections:
Running the test application in Firefox 12 it gives the following output:
Firefox 12 opened and closed 196 WebSocket connections. The 197th WebSocket connection closed with the error 1006. This error is called CLOSE_ABNORMAL and described as follows (MDN/RFC 6455):
Reserved. Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.
Even 3 minutes later, Firefox 12 cannot open new WebSocket connections:
As we can see, Firefox 12 does not allow more than 196 WebSocket connections (200-4). An hour later, I tried to connect to another server. I got the following:
As we can see, even a connection to another server is not possible any more.
An idea
Since version 7, Firefox has the preference network.websocket.max-connections to limit the number of connections that can be open at a time, which default value is 200 (MDN).
I changed that value to 400. Afterwards, the test application opened and closed 396 (400-4) in Firefox 12 until the error 1006 appeared.
Conclusion
Firefox 12 can open and close network.websocket.max-connections - 4 connections. The value seems not to be decremented in Firefox 12, as soon the WebSocket connection is closed.
Bug report
I added it as a bug at Bugzilla.
Tested platforms
- Windows XP (win32)
- Ubuntu 10.04 (linux-x86_64 – 64 Bit)
- Ubuntu 08.04 (linux-i686 – 32 Bit)
Version history (Berlin time)
26.04.2012 – 16:17 — Tested platforms
25.04.2012 – 16:28











