## Message Cost Model

The third equation is the Message Cost Model. The Message Cost Model breaks down the cost of sending a message from one end to the other in terms of its fi xed and variable costs. Simply put, the Message Cost Model equation is as follows:

C = a + bN

» C is the cost of sending the message from one end, say A, to the other, say B
» a is the upfront cost for sending the message
» b is the cost per byte of the message
» N is the number of bytes of the message

This equation is simple to understand and there are two key takeaways from this model:

» Transfer of a message irrespective of its size involves an upfront fixed cost. In terms of messages, the overhead around connection establishment, handshake, and setup are quite common.

» The cost of a message transfer is directly and linearly co-related to the message size.

The Message Cost Model provides some interesting insights into costs associated with transmission of messages across a network. On a gigabit Ethernet, a is about 300 micro-seconds, which is 0.3 milliseconds, and b is 1 second per 125 MB. 1 Gigabit is 1000 Mb or 125 MB. A gigabit Ethernet implies a transmission rate of 125 MBps. A cost of 1 second per 125 MB is the same as 1 ms per 125 KB because 1000 ms make up a second and 1000 KB make up an MB. This means 100 messages of 10 KB each take 100 multiplied by (0.3 + 10/125) ms, which is 38 ms, whereas 10 messages of 100 KB take only 10 multiplied by (0.3 + 100/125) ms, which is 11 ms. Therefore, a way to optimize message cost is to send as big a packet as possible each time, thereby amortizing the upfront cost over a much larger size.

In a theoretical calculation a, the fi xed cost, in the Message Cost Model is considered fi xed for all message sizes but usually that’s not the case. The value of a varies depending on the message size.

Source of Information : NoSQL Enter your email address:Delivered by FeedBurner