We have been running a modified version of openfire and the connection manager for quite some time now, and thought I should start getting some patches back to the community. There was a long-standing bug with connection managers where messages could be received out of order. This first patch attempts to address that.
The reason we are using a CM is so that we could experiment with BOSH without worrying about bringing out main server down (the current BOSH implementation proved to be quite unstable under load)
The patches I am planning to prepare and deliver within the upcoming weeks are:
- Fix for out-of-order messages from openfire to the connection manager module
- This patch ensures that the same connection is used for each stream ID when sending data to the CM
- It also ensures that received messages are processed in order by synchronizing on the client session inside the CM
- It fixes an optimization issue with using the lowercase string “utf-8” for encoding instead of “UTF-8” (details)
- Allow flash clients to connect to the CM by adding a socket cross-domain policy
- Refactoring/redesign of the BOSH module used in the connection manager and openfire
- Upgrade to Jetty7, including the new continuation model
- Clean up code in general, making it much easier to understand
- Fixes stability/OOM issues we were seeing once we got to 1k+ concurrent users
- Add ability to tweak stream compression parameters
- The current default parameters add about 300K of heap overhead for each connected client (details)
- By adding a slightly customized JZLib jar which allows tweaking of window sizes, we were able to reduce this to about 40K, while keeping compression levels very high and limiting the hit on the CPU
- Fix some concurrency issues related to DOM4J
- We found a lot of lock contention on internal DOM4J objects, which were easily solved with a slight modification to DOM4J and some command line parameters.
The links for the patches for issue #1 are below, please let me know if you’re interested in the others:
Connection manager diff
Edit: I should note that these patches were done against stock 3.6.4, but none of the changes are huge, so hopefully integration won’t be a problem.