How to optimize the load time of initial connection and SSL handshake phase of a web page on a 3G network?

by User234334   Last Updated November 05, 2016 09:01 AM

My website www.example.com(SSL enabled) is hosted on Amazon EC2 shared hosting. It loads faster (load time < 2 seconds) on a wifi/broadband connection. Issue is on 3G network in mobile**(H mode and not H+ mode)**. Initiate a connection phase and SSL handshake process takes a lot of time - 12 seconds. Monitored the timing parameters through Chrome Network tab. Below is the measured load timing for the webpage.

Page load Network Timing Stats

Kind of data handled on page: Tested web page receives 5 key-value paired JSON data through AJAX and displays it on the web page. It is a very lightweight page with only 5-6 text content.

I have seen many websites load faster on a 3G mobile network(H mode). My website is too slow during initial connection establishment phase on a 3G network. Can someone please assist me on how to resolve/optimize the delay in initial connection phase? Will moving to dedicated hosting resolve the present issue?

Web Server is not busy and there is lot of CPU AND memory available always.

Server Configuration: Amazon EC2 Instance - Shared hosting (32 CPU and 60 GB RAM). Web Server - Apache. SSL - Symantec.



Answers 1


Initial Connection = TTFB

Your initial connection is considered the TTFB (Time to First Byte), this is considered the time it takes for the device to send a request and then receive the first byte back.

The first byte time is influenced by but not limited to:

  • Distance from user to data centre hosting the server can increase TTFB
  • Uncached GZIP can increase TTFB
  • Congested networks can increase TTFB
  • Congested servers can increase TTFB

It should also be noted that when testing with 3G/4G devices it can cause longer first bytes due to the fact that phone signals vary in strength... this can cause intermittent connection issues and varying latency times.

Investigating the issue

You should first test your server by ensuring that it has enough resources, simply increasing the CPU's and RAM isn't always the best option. Sometimes its better to introduce a load balancer because not only does it mean you can easily run multiple servers side by side but it actually offloads caching and SSL requests. Some other benefits include:

SOURCE

  • Caching: The appliance can store content that does not change (such as images) and serve them directly to the client without sending traffic to the web server.
  • Compression: Reduces that amount of traffic for HTTP objects by compressing files before they are sent.
  • SSL Offloading: Processing SSL traffic is demanding on a web server's CPU, so a load balancer can perform this processing instead.
  • High availability: Two load balancing appliances can be used in case one fails.

Here's some tips I suggest you do:

  • Ensure your database is on the same network, or a quality SQL cloud.
  • Ensure your database is read from memory and NEVER EVER the SWAP file!
  • Make use of a content delivery network, it offloads server requests and compression tasks.
  • Make use of Varnish Cache to reduce load on the database by caching pages
  • Benchmark your static files on the hard disk using HDParm
  • Benchmark your server using Apache HTTP server benchmarking tool
  • Benchmark the website with 10 passes with multiple remote locations using WebPageTest
Simon Hayter
Simon Hayter
November 04, 2016 18:54 PM

Related Questions






Effect on SEO of lazy scrolling on HTML comments

Updated August 21, 2015 18:01 PM