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


    Wednesday, December 10, 2014

    Domino WebSockets & Dashboards... it's like Christmas :)

    ***websocket project has been broken out into its own project, on openntf***
    Hi All,
    Getting close to completing the dashboard application that consumes and renders state information from remote devices / clients via websockets.  As I was building it I couldn't help but notice how festive the colors were.... so I decided to create a quick video of the application accompanied by my favorite Christmas song "Christmas Wrapping" by the Waitresses (links provided to appease the copyright gods).  Normally the app would not overwrite any errors (red), or warnings (yellow), but I disabled that logic to keep the colors going throughout the song :).  The JUnit test randomly selects the target location of the device (room number in this case), and also randomly selects the socket message data (error, warning, OK).  The client side JavaScript receives the message, then queries the DOM for the location and alters the .css class reference to change the color.  In addition to the UI, you should also notice the RhinoClient running in the console updating the documents on the back-end if an error or warning is sent in from the device.  Anyway... I guess I hit the eggnog a little early this year... Merry Christmas!

    link to video