I found you can use fio, which is a generic I/O testing tool, to achieve this. fio allows specifying the transfer rate and also has a network engine. So using fio I can configure one host as the receiver and one as the sender and transfer data at a known rate. Here's what the config files look like:
Sender jobfile.ini:
[test1] filename=receiver.dns.name/7777 rw=write rate=750k size=100M ioengine=netReceiver jobfile.ini:
[test1] filename=localhost/7777 rw=read size=100M ioengine=netObviously you would replace "receiver.dns.name" with the DNS name of the receiving host, and adjust the size and rate parameters as you like. (It's worth noting that the fio documentation is either wrong or misleading on what the filename should be for the receiver. It claims the receiver should only specify the port, but when I tried that it failed to run. Setting the host to localhost seemed to work and the receiver started listening.) To run the test, simply run:
fio jobfile.inifirst on the receiving host, then on the sending host. fio will then transfer 100 Megabytes of data at a rate of 750KB/sec between the two hosts. And we can see from the chart that indeed a constant rate was generated:
The observed rate is a bit above the 750KB/sec specified, but what's being measured is the number of bytes being transferred through the eth0 interface. Since the data is transferred over TCP there is some overhead to the packet structure, which I believe accounts for the extra few KB/sec observed.
how to get that graph generated.And is there a way to set max io delay time in job file.
ReplyDeleteYou can use collectd/rrdtool to get these graphs. See my blog entry: http://gabenell.blogspot.com/2010/06/setting-up-collectd-collection3-on.html
ReplyDelete