Question

We were looking at MSMQ for persistent ‘push’ server to client communication. There can be up to 1000 clients per server.

In one of our tests, we sent a small message to 300 offline clients, and then sent a message to an online client. The last message was delayed by over 40 minutes as MSMQ worked its way through the undeliverable messages (observed via the MMC). We also use MSMQ for the return path where it works well.

Is there any way to make MSMQ fit this pattern of usage by reducing the amount of time it attempts to connect to an offline host? If not, is there any other queuing product that would be a better fit, or is it roll your own time? Raw throughput is not a priority, but number of outgoing queues and predictability/maximum latency are, as is memory footprint on the clients (which can be fairly old machines).

Was it helpful?

Solution 2

Our solution was to programmatically pause the queues to machines that were offline (we already had a UDP message to tell if clients are up) via one of MSMQ's management COM interfaces.

With queues to known-disconnected hosts paused, MSMQ spent much less time working its way through undeliverable messages.

It was also a nice lesson to apply a bit of lateral thinking when thinking up tests for evaluating technologies! In general I wouldn't recommend MSMQ for server to client comms because of this issue - I'd say polling by clients would be preferable.

OTHER TIPS

You can increase performance by disabling journaling and making the messages non-recoverable... if you don't care about messages getting lost.

A quick fix with your offline scenario could be to increase the number of threads available to MSMQ which uses a thread per outgoing queue. Each offline connection attempt takes a while, blocking a thread. http://technet.microsoft.com/en-us/library/cc957498.aspx Try throwing as many threads at it as you can.

My peers have worked with ActiveMQ and have said it's much more flexible while performing better. I haven't personally worked with it but I'd look into it if you're not tied to .Net.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top