Friday, August 31, 2007

Send Network Packets to a Host with spray

The spray command is used to send packets to a hostname, URL, or IP. It reports how many packets were received and transfer rate. However, spray can NOT be used as a network benchmark because it uses unreliable connectionless protocols such as UDP. Here's an example of its use on my box.

# spray esoft
sending 1162 packets of length 86 to esoft...
754 packets (64.888%) dropped by esoft
26 packets/sec, 2317 bytes/sec


C said...

OK, I am barely out of my diapers as a Junior Sysadmin, but spray? Really?

Not only does that packet loss seem excessive, but the man page itself actively states that spray is not useful for benchmarking network performance...

I quote:
"spray is not useful as a networking benchmark, as it uses unreliable connectionless transports, UDP for example. spray can report a large number of packets dropped when the drops were caused by spray sending packets faster than they can be buffered locally, that is, before the packets get to the network medium."

esofthub said...

C, I'm not suggesting that anyone use it. This post is more of an FYI and then you draw your own conclusions. If anything, why not to use it. Roy

esofthub said...

oh boy, C I just reread my post. Now I know what you are talking about. I'm going to make the edit. Thanks for the comment. Sorry about that.