Posted by: Airtower | 2010-06-09

NBD over a slow connection

My previous experiments with NBD used small files and fast connections. Today, I tried a different scenario: both server and client used normal DSL connections.

Obviously, setting up the NBD was somewhat slower compared to my home network. What really surprised me was the time it took to create an ext4 filesystem on the 20GB network block device: slightly more than one hour. I used iotop to monitor the data throughput and found that mke2fs wrote about 115KB/s. Lesson learned: If you have the possibility, create the filesystem on the server and export the NBD ready to use.

Performance test

For this test, I copied three big files to the NBD. Copying was done using rsync with a subsequent call to sync to make sure that caching didn’t change the result. I used date +%s to create timestamps. Before I get to the results, these are the statistics form rsync’s --progress option:

110605205 100%   20.02MB/s   0:00:05 (xfer#1, to-check=2/3)
123533832 100%  127.37kB/s   0:15:47 (xfer#2, to-check=1/3)
 81317264 100%   22.38MB/s   0:00:03 (xfer#3, to-check=0/3)

The very high transfer speeds for the first and last files are a result of the filesystem cache. Rsync is done, and the data will migrate across the wire in the background. To find out when this was done I added the sync, and here are the results:

  • rsync start to finish: 1688 seconds
  • rsync finish to sync finish: 912 seconds
  • total: 2600 seconds

With a combined file size of 308063 KB that’s an average transfer speed of 118.5KB/s or 948Kb/s. According to the ISP, my connection should have an upstream speed of 1Mb/s. That’s a small overhead for SSH and NBD. 🙂


Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: