Thursday, April 17, 2014

Network performance test using ftp protocol

You can use the ftp command to send a very large file by using /dev/zero as input and /dev/null as output. This allows you to transfer a large file without involving disks (which might be a bottleneck) and without having to cache the entire file in memory.
Use the following ftp subcommands (change count to increase or decrease the number of blocks read by the dd command):
ftp> bin
ftp> put "|dd if=/dev/zero bs=32k count=10000" /dev/null
The above command transfers 10000 blocks of data and each block is 32 KB in size. To increase or decrease the size of the file transferred, change the count of blocks read by the dd command, which is the count parameter, or by changing the block size, which is the bs parameter. Note that the default file type for the ftp command is ASCII, which is slower since all bytes have to be scanned. The binary mode, or bin should be used for transfers whenever possible.

No comments: