Cloudflare server high latency

#1

My site server is located in Bangalore, India and majority of my visitors are from Pakistan, India and Middle East. I also knew that Cloudflare have their datacenters in 3 different locations in my country and their data centers are also available in India. When I tried to check the latency with traceroute, this is what I gets:

From 1-12 are my local hops from my country, Pakistan. Afterwards 13-15 are Cloudflare datacenters which are located in Italy and then finally no. 16, a Cloudflare origin server in US. I wonder why Cloudflare have chosen its Italy based server when there are datacenters available in my country and in India, Middle East too. Also this Italy based server latency is very high.

Is there any possibility to improve these latencies?

1 Like

Possibility to change NS record
Surprisingly slow TTFB. Index not downloaded from Cloudflare?
#2

This is usually a routing issue with the user’s ISP. Here is some information as to why some users are routed far away:

3 Likes

#3

I guess you’re free or pro user, and india maybe is another premium location that available for business or enterprise user.

0 Likes

#4

The ISP still has only decision which route traffic takes and it’s usually the ISP’s business plans (not residential) that gets priority (if any).

1 Like

#5

Thanks a lot. It was an issue with my ISP, as soon as I switched to different ISP it took less than 50ms and only 8 hops instead of 16. This ISP has partnered with Cloudflare and they are linked to their servers in my country. :slight_smile:

image

3 Likes

#6

I have now another small issue. The latency is now less than 50ms, I was expecting my site with Cloudflare to response back in ms but its taking about 1.2s. If I directly access my origin server then it loads in about 0.5s. Here are my 2 links (cloudflare, origin) to webpagetest.org as suggested for a test at this link.

Any suggestion? I am now in doubt that there might be some settings issue with Cloudflare. :confused:

0 Likes

#7

Curiously enough, I just found out that the reason one of my websites has shed about half a second of it’s load time (from ~2.0 secs to ~1.5 secs) in the past week or so, as recorded by GTMetrix, is that it is now being served out of GRU, instead of a US colo.

Nevertheless, my other 3 domains are still recording EWR, MIA or IAD as their colo, according to the GTMetrix São Paulo servers and my own trace route. They are all on the same Cloudflare nameservers. Go figure!

2 Likes

#8

Here is my another timeline for Cloudflare and Origin server.
Origin:
image

Cloudflare:
image

It clearly shows that the Content Download time in both requests are almost same which means that there is no issue with my server itself. The time exceeds only in TTFB. I wonder what fishy is happening inside Cloudflare.

0 Likes

#9

Here is my origin server traceroute:

Its very odd… Origin server is having about 18 hops but still gives TTFB of only 0.5s. Cloudflare server have 8 hops but it gives TTFB of 1.34s.

0 Likes

#10
0 Likes

#11

TTFB will be a bit longer (but typically not an entire second) because Cloudflare needs to get the Page Source from your server, then deliver it to your visitor. But overall load time should be significantly shorter as static content becomes cached and delivered directly to your visitors.

What is that timing screenshot from? If you post your domain name, we can do some looking around regarding performance.

0 Likes

#12

That screenshot is related to the API link which I am testing for performance. APIs are dynamic so there is no way to cache them. or may be I am thinking to use my Origin server for API purposes and Cloudflare for site.

0 Likes

#13

Ideally, set some test up on the origin then log tests from various ISP/Locations.

This is what I’m getting from my site. It really helps to find good hosting.

Home
1 ms <1 ms <1 ms xx.xxx.xxx.xx
11 ms 9 ms 9 ms xx.xxx.xxx.xx
16 ms 17 ms 15 ms xx.xxx.xxx.xx
18 ms 18 ms 17 ms xx.xxx.xxx.xx
23 ms 24 ms 24 ms cloudflare.peer.qix.ca [198.179.18.55]
24 ms 24 ms 23 ms xx.xxx.xxx.xx

Office
1 ms <1 ms <1 ms xx.xxx.xxx.xx
1 ms 1 ms 1 ms xx.xxx.xxx.xx
6 ms 6 ms 6 ms XXXXXXXXX.torontointernetxchange.net [xx.xxx.xxx.xx]
6 ms 7 ms 6 ms cloudflare.ip4.torontointernetxchange.net [206.108.34.208]
6 ms 5 ms 5 ms xx.xxx.xxx.xx

1 Like

#14

I do have one concern now, that since the traceroute result of my domain is less than 50ms and my cloud server based in Bangalore made internal processing in about 0.02s. Then Cloudflare should receive the response (TTFB) within 100-120ms. But my concern is the Cloudflare IP address assigned to my domain is 104.31.76.47 which is based in US whereas my cloud server is based in Bangalore.

I am in doubt that if Cloudflare assign the IP also based on their India server, then it may further reduce the TTFB time. What you guys say? Is this possible?

0 Likes

#15

Those IP addresses are on the Anycast network, so traffic is routed to the closest location, much like how Google’s 8.8.8.8 is routed to their nearest datacenter.

0 Likes

#16

Routed to their nearest location? My cloud server is hosted in Bangalore, India and how come the closest location calculated by Cloudflare is in US instead of India?

0 Likes

#17

I wasn’t very clear. It’s not always Geographically closest, as I explained in an earlier post on Peering.

0 Likes

#18

The problem is with fixed IP (104.31.76.47) assigned to my domain from Cloudflare when I register my site for their CDN. Even I have purchased Argo service but this IP never change.

I am thinking to move my cloud server also to New York, US, may be it create a difference. What you say?

0 Likes

#19

Or Cloudflare can change IP to India based, if I contact their support?

0 Likes

#20

Please read the Anycast section of the article I linked to.

1 Like