Sunday, December 28, 2014

Domino Websocket Fixes & Performance testing for v1.1.3

***websocket project has been broken out into its own project, on openntf***

The latest release of Domino Websockets v1.1.3 focuses on bug fixes and performance.  Most notable fixes include:

  • Fixed memory leak for users with closed websocket connections.  This was causing java.lang.OutOfMemory errors during consecutive test runs, and left users in an inconsistent state in the backing ConcurrentHashMap and user document.

  • Increased routing performance by only serializing the routing attributes of SocketMessage, and only making the serialization call once. This also helped to eliminate java.lang.OutOfMemoryErrors.

  • Cleaned up the SSJS Rhino client implementation to now render the script path in the user profile instead of just a UUID.

  • Fixed problem when transitioning from Anonymous to Authenticated users that already have a websocket session established.

  • Added the following notes.ini parameters:
    • WEBSOCKET_THREAD_COUNT defaults to 2 (This only impacts threads loaded for routing. Websocket workers are still equivalent to the number of cores / CPUs on the host machine.)
    • WEBSOCKET_ARRAY_QUEUE defaults to false (allows admin to change the internal data structure from LinkedBlockingQueue to ArrayBlockingQueue.  No performance advantages were seen during testing.  This was added to see if a bound blocking queue would reduce the memory footprint during JUnit test runs.  Performance results were inconclusive)
    • WEBSOCKET_ARRAY_QUEUE_SIZE defaults to 10k (if WEB_SOCKET_ARRAY_QUEUE is set to true, uses this value to set the upper bound of the array blocking queue).
    • WEBSOCKET_PURGE_INTERVAL defaults to 900 sec (instead of relying on agents to cleanup expired messages and users).

Latest benchmarks for performance are:
  • 2000+ concurrent users during JUnit test runs

  • 1 million messages sent via 'Broadcast Many' agent in approximately one minute (loop back address used so no network latency, and message was only 270 bytes).

    • VariableSizeWebSocket load test pushed messages varying in size from 50kb to 25mb without any OutOfMemory errors.  Transferred about 12gb of data over 15 minutes to 2000 clients.

    Testing Environment:
    • Both test client and server were running off the same machine (localhost used, no network latency).
    • -Xms1024M -Xmx4096M for client execution
    • Hardware:
      • MacBook Pro
      • 16gb RAM
      • SSD (Solid State Hard Drive)
      • Core i7 (quad core processor)
    • Relevant notes.ini settings were
      • HTTPJVMMaxHeapSize=4096M

    To re-create tests see plugin project.

    FYI, I haven't had time to test the last few releases across a Domino server cluster (requires borrowing my boys gaming rig... they aren't too happy as I typically borrow it for a week at a time :). That is on my ToDo list for next year.  If you set this up on a cluster, please let me know your results.... thanks for stopping by!

    download from OpenNTF



    Csaba Kiss said...

    Does this extension still need the Bootstrap4XPages plugin since the latest OpenNTF extlib has the bootstrap built in ?

    Mark Ambler said...

    The websocket plugin doesn't have a direct dependency on the BootStrap4XPages plugin. I believe it is only required for the airts.nsf sample application (iOS WebShell demo app).

    Csaba Kiss said...

    Thanks, Mark. Do I need the OpenNTF extlib package for the pure websocket extension? It would be nice if I could just install updatesite and drop the websocket.nsf into the domino for websocket functionality.