Matt
Matt

Reputation: 349

Does SSL cause a lot more bandwidth?

I know SSL has a performance hit on your HTTP communication in terms of speed but is there much of a difference in the amount of data transferred?

ie, If a mobile device is paying a lot per kb, is there a huge difference? Does anyone have an estimate of how much of a difference?

Thanks for the help!

Matt

Upvotes: 11

Views: 7771

Answers (3)

sup
sup

Reputation: 807

I just did a test using wireshark, downloading a 5-byte file from Amazon S3 over http and https to an iPad using a simple NSURLConnection request.

For http, total traffic was 1310 bytes.

For https, total traffic was 7099 bytes.

This was just for a single download in each case, and includes all back-and-forth over-the-wire traffic associated with the request, including DNS (about 200 bytes) and TCP handshaking (about 400 bytes for the http case).

Obviously the actual totals would change according to URL length and your particular SSL certificate; you could certainly have leaner headers than S3 delivers.

In theory, the SSL bandwidth overhead for a 1MB file should be about the same as a 1-byte file, i.e. about 5800 bytes in the above example, as encryption shouldn't increase the size of the data transmitted beyond the initial certificate and key exchange. So for large files it's negligible, but for small files can be significant, as pointed out by Eugene.

Upvotes: 8

As Borealid pointed, the overhead is small. Usually. For an average request (which extends to multimegabyte files).

However if you have something like RESTful APIs to call, you need to ensure that persistent connection is used, otherwise with small request bodies SSL will add significant overhead. I can't tell you exact numbers now (simply because they vary depending on certificate size and number of certificates in the chain) but if you have to establish SSL session to send a 200-byte request and receive a 2-Kb response, SSL handshake can add another 5-7 Kb easily, so you see the overhead.

Upvotes: 10

Borealid
Borealid

Reputation: 98519

No, there is not much of a difference, neither in terms of "performance" nor in terms of bandwidth.

According to Google, a company one would hope is a reliable source on large-scale networking, the network-bandwidth overhead is less than 2%.

Upvotes: 10

Related Questions