Monday, February 20, 2012

Message compression

We have run some tests on our application. Average message is about 2.5 MB. Messages are send once every 30 minutes. This is 3.5 Gb per month for one site. Now we already have three sites that will be sending this messages. This will be VERY high load on the WAN channel, and will cost us a LOT of money Tongue Tied.
Isn't it possible to add some compression? XML should compress very well, this feature will make brokers more useful.Service Broker messages are not required to be XML. They can simply be blobs. So you could perform the compression and decompression fairly easily in your app and send compressed messages through the Broker. That way you control the compression algorithms and not the system.|||

Some tips for reducing the traffic when using Service Broker:
- use binary messages instead of XML
- compress the message payload in the application, before calling SEND
- use one long lived dialog to send all messages, don't start a new dialog for every message
- few large messages is better than many small messages
- use short names for services, contracts, message types

I'd add that Service Broker is quite unchaty. For instance, there is no handshake for dialogs: first message SEND on the dialog is the first message sent on the wire.

HTH,
~ Remus

No comments:

Post a Comment