Optimal Size - SendingQueueSize for high count transmissions

Sep 17, 2014 at 8:15 AM
Edited Sep 17, 2014 at 8:15 AM
Hi Kerry,

I'm building a publish subscribe system which has a minimum 1000 active clients subscribing to event broadcast.

I have been doing load testing and noticed since I upgrade recently to SuperSocket 1.5+ (currently using 1.6.3), I noticed it couldn't handle a lot of broadcasts - it would be very slow once I flood the session with events.

After playing around, I increase the sendingQueueSize to 1000 (Default = 5), it seems to make it, but sometimes, I can still see sometimes, the session.Send to lock (supposedly async sending, am I correct?)

Could you explain how the SendingQueue works? I believe, I read on another thread, when sending queue is full, it become synchronous.

So, I'm thinking possibly, setting the sendingQueueSize to a large number, but, not sure what would be the issue beside more RAM?

Thank you very much
Coordinator
Dec 4, 2014 at 4:25 AM
Yes, sending queue is the queue for sending of each connection. If the queue is full, Send method will be locked, if lock time exceed the defined timeout, a timeout exception will be thrown. To avoid the locking, you can use TrySend method, which can return false if the queue is full. So you can use the return value to control the sending frequency.