Score:2

Initial connection (TCP handshake) takes 150 seconds first time with https only, but normal from then onwards - Apache - AWS EC2 - Route 53

in flag

I'm new to web deployment. I have this at this stack at the moment:

  1. Django
  2. Apache
  3. EC2
  4. Route 53
  5. Namecheap

When I access the website through the public IPv4, it is instantaneous.

However, when I access the web page through the domain, it takes 2 minutes and 30 seconds exactly.

This picture shows the waterfall graph

In more detail

I see that there's no problem with the DNS lookup, nor the SSL, so the problem must be the TCP handshake?

It is also strange that each initial connection takes 75 seconds precisely, and I have looked for this value in Apache's configuration.

There is no problem with the redirect (via Apache) because the problem persist nomatter what initial URL is used.

There should also be no problem with Django or EC2 because when I load it using the public IP, the page loads instantly 10 out of 10 times.

KeepAlive has been turned off. WebPageTest shows a similar graph, but 30 seconds for the initial connection and TTFB instead of 2 minutes 30. Again, DNS and SSL are both okay.

I am using Apache 2.4 and Ubuntu 20.4.

Thanks everyone.

One more diagnostic from WebPageTest

A. Darwin avatar
my flag
Can you run tcpdump -nni any port <web server port> -vvv n the server itself and see what happens? Also what is your client OS?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.