• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 867
  • Last Modified:

https slower than http


I have a webcam on apache that if accessed from http it displays 1 image every second. If accessed thru https it displays 1 image every 3-4 seconds.  Is there some configuration that will speed up the SSL access?

2 Solutions

I would say that it will be normal for HTTPS access to be slower than HTTP.  Note that connection via HTTPS will be encrypted/decrypted at server and client side -- this will tax some performance. In addition, normal HTTP documents can be cached by server and client, but not stuff that goes thru HTTPS protocol.

However, I could not give an exact figure on how much degration in performance.  But definetely there is.

Alex -

I would agree entirely with samri - HTTPS requires more overhead on the server and browser side, and therefore will slow the speed of display.
I agree with the above statements.  Also the encrypted form of data bigger than in its unencrypted form.
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

alexzaleskiAuthor Commented:
Of course I agree that SSL/https requires more overhead but don't you think that a picture displaying 1x/sec vs. 1x/3-4 seconds (300%) it quite a lot?

Are there any Apache configs that i can tune?

I don't think there is anything you can do to improve the performance. After all you are encrypting a larger binary file as apposed to a smaller text file.

To prove this;
Create a text file the same size as a binary file and time the two...

I would suspect that the times would be the same or marginally different.

The performance hit is not caused by the encryption and decryption processes, unless your client or server is overloaded.  It's more likely that your problem is caused by network latency.

On each connection, the client and server have to "set up a secure connection" which involves several iterations of the client waiting for the server, then the server waiting for the client's response.  Depending on the round-trip time for IP packets between your client and your server, this can add up to a noticeable delay.

(You can test this theory by putting the client and server on the same network.  If I'm right, the delay will become negligible.)

You might also be refreshing two files each time: an HTML file, and an image file.  This effectively makes the above problem twice as bad: the browser won't even start the second connection until the slow part of the first connection is finished.

A workaround is to fetch the HTML page via HTTP and the image via HTTPS.

You could also upgrade all the networks between the client and the server.  :)
Recommendation: split points between samri and tomclegg - I feel that both explanations could be the cause, and since the author didn't come back, no one will be able to tell which was correct.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now