I am looking at Newrelic which says, Haproxy responds in 100-150ms average. Also, my backend usually respond within 90-120 sec (using Ruby on Rails, mySQL, Memcache).
But TTFB according to WebpageTest is 1.48 seconds - I have tried multiple tools and tested various page types on site but all of them come with fairly high TTFB.
If you give us your origin IP address, we can them compare to see if it’s Cloudflare adding time or not.
Also - if you were to use a page rule to cache the entire home page (including html), you can get the TTFB close to 20ms, and full html download under 50ms.
Cloudflare isn’t going to speed up TTFB if your main page isn’t cached (I could be wrong on this). Cloudflare is actually going to add a bit of overhead to TTFB as it fetches the main page from your origin server.
What’s really going to matter is the overall load time of your site, which should be greatly improved through appropriate use of Cloudflare.
TTFB direct to origin:
Connect: 0.260 TTFB: 1.255 Total time: 3.324
Connect: 0.265 TTFB: 1.158 Total time: 3.794
Connect: 0.261 TTFB: 1.121 Total time: 3.455
It also appears when testing from that particular colo their connection is to our CDG POP which is in France. That could be a function of the EC datacenter in the test having unique connectivity/ BGP routing or it could be a function of colos in that region available for the plan type for your domain.
Tools like web page test are good, but they aren’t run from endpoints where user eyeballs are so their results can be different from what users experience. You can connect to https://www.myupchar.com/cdn-cgi/trace and the colo corresponds to airport codes which how we geographically identify our POPs. If you also see a very distant POP plan type may be a factor, but TTFB for the page is a little high regardless (even direct to origin).
It shows a colo of LHR whereas 99% of traffic originates from India. Is that an issue? How can we address that?
Also, you mentioned that TTFB, when you bypassed Cloudflare, is still 1.2 seconds. However, two reports from Newrelic indicate that LB responds in 150ms and backend servers are also fairly fast.
Also, is there a possibility of getting this addressed in Business plan? We can try to use cookies for signin vs sessions that we use now. It seems that there is an option to bypass page caching if there are cookies in it.
I used the same commands that you shared but my TTFB is very different (from an Indian server pinging another server in a different C Class but same hosting company, DigitalOcean)-
When I bypassed Cloudflare -
Connect: 0.002 TTFB: 0.098 Total time: 0.101
Connect: 0.002 TTFB: 0.089 Total time: 0.659
Connect: 0.002 TTFB: 0.186 Total time: 0.549
When I executed the second command and it went through TTFB -
Connect: 0.206 TTFB: 1.832 Total time: 3.633
Connect: 0.160 TTFB: 1.489 Total time: 2.190
Connect: 0.154 TTFB: 1.460 Total time: 2.697
The this test was from 2 machines in the same datacenter? I would generally expect the results to be ridiculously fast (and they are). But that doesn’t mimic or correlate to what end users will see in terms of performance. The speed of light is fast, but it’s not infinite… there’s a certain level of latency which is going to be introduced through distance and each network hop that is simply unavoidable. For my two tests for example my direct test went from Austin, TX (US) to the origin server which I assume is in Bangalore since it’s DO. That’s a 19,000+ mile round trip and my colo location adds another 3000 miles to my tests through Cloudflare due to my personal network configuration. Time and hops add up.
For data hosted in Bangalore it’s probably not the ideal route for users to hit a POP in LHR, but for the plan you are currently on it may be the closest available colo for your particular network/ plan type. I suspect you would probably get better performance in the current scenario if the content were hosted on one of the DO instances in Europe.
Cloudflare sales or support login to Cloudflare and then contact Cloudflare Support might be able to tell you if additional POPs in India are available on the Pro and/or Biz plan, sorry I don’t have the current details there. Ability for users to hit a closer POP would also likely also help improve TTFB given it appears the DC hosting the origin server is also in region. India is a key area for expansion and growth for Cloudflare… I actually keep trying to convince my boss I need to go on an extended visit to spread Cloudflare love there.
Cloudflare business plan does offer bypass cache on cookie. Session is a little harder if it’s not defined by a cookie… custom cache key might be an option (that’s an ENT feature only today unfortunately). Finding the right balance for caching at the edge for customized content can be a tricky business… Railgun might also help for dynamic content performance and Argo is is another possibility as well.
Your TTFB is also extremely high when going direct to the origin. So for uncached requests/ dynamic content we have to wait on the origin as well. For pages where you can leverage cache everything that might help, but for dynamic content a less overloaded origin and/or possibly railgun might help.
Both of your commands directly hit the origin server. By specifying your origin IP address, you’re bypassing Cloudflare. My eyes may have missed something, but both commands are identical, correct?
Cloudflare limited Indian pops to paid plan. (Official said on another topic).
But I have noticed my another free plan website
Used MAA Chennai Indian location.
How frequently these collocations are change?
How much percentage of traffic routed through specific colocation?
Since my traffic is 100% from India. Any other ways to optimize it.
Maybe blocking all countries other than india, is this route colocation servers India only.
Is it better turnoff Cloudflare?
How to use Cloudflare only as dns proxy?so requests serves from origin data center.
I know some POPs don’t serve free plans, but I haven’t seen an official list. I think it changes from time to time as costs come down. I don’t know if they limit how much of your traffic would go through a more expensive POP. I’ve not heard of such an arrangement.
Blocking countries from your website most likely won’t change this. Maybe a paid CDN company has datacenter in India. But at that point, you could just pay for Cloudflare. I’ve used KeyCDN in the past and their prices are decent, though Asia traffic costs 3x Europe/North America. They have a POP in Bangalore. Maybe the $20/month here is the best deal.
You can certainly turn off the Cloudflare proxy by setting your DNS entry to . You’ll get very fast DNS performance, with the benefit of your local datacenter.