Sunday, July 27, 2008

7z Zip and Transfer Speed Comparison

I regularly backup my databases and transfer them from the server to a local machine. My strategy is to use the 7-Zip compression utility to compress the database first and then transfer it. A smaller file will obviously transfer faster and locally I'm going to zip it anyway to save space if I'm not using it.

Today I had a situation where I was going to use the DB once I'd transfered it so it was a matter of zipping, transferring, and then unzipping. While I watched the file zip I was surprised at how long it was taking to zip and wondered if I was gaining or losing by doing the zip-transfer-unzip steps rather than just do the transfer. So I measured what I was doing.

The file size unzipped is 47Mb and zipped is 6Mb. The transfer rate is around 12 MBS (Cox Cable).

Method 1: zip - transfer - unzip:
zip: 95 seconds
transfer: 27 seconds
unzip: 3 seconds
Total: 125 seconds

Method 2: transfer
transfer: 192 seconds

Contrary to what I thought, the zip-transfer-unzip method is about 35% faster. This would obviously scale to better performance if your connection speed is slower.

Something else that you should consider is being a good net-citizen and use less bandwidth than you need to which fits in with the results of this experiment. In fact, I think if we were charged (even partially) on the bandwidth we use instead of paying a fixed amount for an unlimited amount it would have a great impact on the web's availability.

1 comment:

  1. does 7zip have a "speedy" option? maybe you could zip it while transferring/