[xSocket-develop] scalability and latency
Status: Inactive
Brought to you by:
grro
|
From: James O. <Jam...@co...> - 2008-04-04 12:06:21
|
I'm experimenting with xSocket 2.0-beta-2 and xSocket-http 2.0-alpha-4 to implement a messaging server that pushes messages to http clients. The messages are small (approx 15 bytes) but frequent (enqueued at a rate of 25 per second per client). These messages are in 10 logical topics and only the latest available message from each topic is sent, i.e. when a new one is queued to be sent it overwrites any message already queued for the same topic. The server infrastructure will also concatenate several smaller messages to make one larger message if messages are available on multiple topics at the time of writing to the BodyDataSink. Thus the number of messages dequeued and sent to the clients is automatically throttled by the capability of the underlying comms. I have the same setup with Tomcat 6 using the NIO connector and find that I can add large numbers of users and still get good performance. With the hardware I have it can deliver 70,000 messages per second. More users mean fewer messages per user but the overall throughput remains the same and latency is low and fairly consistent. However I'm finding that this does not scale as well with xSocket. The max message throughput is lower and reduces as more clients are added. The average latency is higher and can be highly variable (>10 seconds!) depending on the number of background message writing Threads and the number of Dispatchers. Making the number of message writing Threads equal to the number of Dispatchers and keeping them both quite low (<= 3) reduces the latency variability but the average is still significantly higher than with Tomcat. SYNC flushing is also better than ASYNC with this setup because it causes more message concatenation (fewer larger messages sent). The xSocket API has been a joy to work with and allows me to do more than with Tomcat/Comet (e.g. if desired the client can continue to write to the connection) and the memory use is incredibly low, however the performance for my scenario is worse than I was expecting. Is there something I might be missing in my config or is this not a scenario that xSocket is currently optimal for? *********************************************************************************************** This email, its contents and any files attached are a confidential communication and are intended only for the named addressees indicated in the message. If you are not the named addressee or if you have received this email in error, you may not, without the consent of Cognotec, copy, use or rely on any information or attachments in any way. Please notify the sender by return email and delete it from your email system. Unless separately agreed, Cognotec does not accept any responsibility for the accuracy or completeness of the contents of this email or its attachments. Please note that any views, opinion or advice contained in this communication are those of the sending individual and not those of Cognotec and Cognotec shall have no liability whatsoever in relation to this communication (or its content) unless separately agreed. *********************************************************************************************** |