Alright, so I setup the following test:
- Hardware: 2 desktops Intel Core Duo CPU @ 2.33GHz, with 4G of RAM.
- OS: Ubuntu 11.10 on both machines
- Network: 100Mb dedicated switch, both machines are connect to it.
- Software:
- Python HTTP server (inspired by this).
- Python FTP server (inspired by this).
- Python HTTP client (inspired by this).
- Python FTP client (inspired by this).
I uploaded the following groups of files to each server:
- 1 100M file.
- 10 10M files.
- 100 1M files.
- 1,000 100K files.
- 10,000 10K files.
I got the following average results over multiple runs (numbers in seconds):
|-----------+---------+----------|
| File Size | FTP (s) | HTTP (s) |
|-----------+---------+----------|
| 100M | 8 | 9 |
| 10M | 8 | 9 |
| 1M | 8 | 9 |
| 100K | 14 | 12 |
| 10K | 46 | 41 |
|-----------+---------+----------|
So, it seems that FTP is slightly faster in large files, and HTTP is a little faster in many small files. All in all, I think that they are comparable, and the server implementation is much more important then the protocol.