On 1/7/2013 4:01 PM, me 2 wrote:
> I figured that if anyone else had this problem, then it would be
> worth passing on this information.
>
> http://activemq.2283324.n4.nabble.co...td3718866.html
>
> According to this, an empty message with no other information is
> about 300 and some odd bytes. So, the plain socket in our extremely
> low bandwidth project might be better served with plain sockets. Not
> the answer that I wanted, but still, at least, an answer.
That may be the case. Or it may not be the case.
If you want to know then measure.
If you expectation is that:
number of messages per time unit = constant * theoretical bandwidth /
message size
then you will be wrong for most networks.
I wrote a little test program (Java socket) to measure
the time it takes to send 1 million messages for
different message sizes.
Result:
size 100 : 4633 ms
size 200 : 4681 ms
size 300 : 4697 ms
size 400 : 4712 ms
size 500 : 4728 ms
size 600 : 4743 ms
size 700 : 4791 ms
size 800 : 4805 ms
size 900 : 4822 ms
size 1000 : 4852 ms
size 1100 : 4853 ms
size 1200 : 4899 ms
size 1300 : 4931 ms
size 1400 : 4915 ms
size 1500 : 6834 ms
size 1600 : 6912 ms
size 1700 : 6865 ms
size 1800 : 7005 ms
size 1900 : 6974 ms
size 2000 : 7130 ms
size 2100 : 7255 ms
size 2200 : 7318 ms
size 2300 : 7317 ms
size 2400 : 7302 ms
size 2500 : 7380 ms
size 2600 : 7395 ms
size 2700 : 7567 ms
size 2800 : 7583 ms
size 2900 : 7442 ms
size 3000 : 8082 ms
size 3100 : 8222 ms
size 3200 : 8191 ms
size 3300 : 8332 ms
size 3400 : 8222 ms
size 3500 : 9330 ms
size 3600 : 9407 ms
size 3700 : 9533 ms
size 3800 : 9377 ms
size 3900 : 9423 ms
size 4000 : 9439 ms
size 4100 : 9439 ms
size 4200 : 9517 ms
size 4300 : 9533 ms
size 4400 : 10359 ms
size 4500 : 10484 ms
size 4600 : 10407 ms
size 4700 : 10499 ms
size 4800 : 10578 ms
size 4900 : 10484 ms
size 5000 : 10500 ms
You will see that it does not grow linear instead it jumps
at multiples of X (where X is somewhere between 1400 and 1500
bytes).
Your absolute number may be very different.
And your X may be different.
But you should not be surprised if you see the same
effect.
And it does impact your conclusion.
If payload+300 < X then the 300 has practically
no impact on performance.
If payload < X < payload+300 then the 300 will have
a huge impact on performance.
And so on.
So you need to analyze and test more - otherwise you
could just as well have flipped a coin.
Arne
PS: If somebody want a copy of the code, then I will be happy
to post it, but it is rather trivial and somewhat unpolished.