Our website is https://www.addy.co.nz/, providing address autocomplete and address validation to New Zealand customers. The predictive, suggest-as-you-type address autocomplete API should be really fast to provide a great user experience.
We’ve started using Cloudflare for DNS and load balancing. We’ve also enabled Argo for improved performance.
It takes between 800ms to 1300ms to complete an address search request when hitting the Cloudflare cache to fetch requests.
3. No Cloudflare - Direct Origin Access
Bypassing Cloudflare and making requests to origin servers in Melbourne and Sydney directly takes between 45 to 70ms to complete from New Zealand on a fiber connection.
It appears like Cloudflare adds a huge latency performance tax of at least 300ms+ per request.
Is this type of performance expected? (e.g. 500ms instead of 50ms?)
Did we configure something wrong, which could cause the poor performance?
Are other experiencing the same performance?
What is the expected before and after Cloudflare performance?
I take it you are referring to the request to https://api.addy.co.nz/search, right?
You’ll hardly be able to get 50 milliseconds, as you go through a proxy tunnel after all and that simply does add additional hops and work. It shouldnt take a second however. Can you post the output of https://api.addy.co.nz/cdn-cgi/trace?
One weird thing is that I, too, experienced quite a delayed response time (~1200ms), when it suddenly jumped down to 300ms. Have a look at these timings and ignore the favicon requests.
Thanks for looking into it. You are right, it is the /search API.
Here is the response from Fiddler. Using api.addy.co.nz/search (Cloudflare load balanced) is a lot slower compared to hitting the Melbourne or Sydney servers from New Zealand.
Here is the output from the cgi path:
uag=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36
We are using the Cloudflare load balancer to route traffic to the origin servers (image 2).
I’ve even turned off all the caching and everything else, still terrible performance (image 3).
How much latency does Cloudflare, used as a reverse proxy, typically add to a request? I wouldn’t have thought it would make such a big difference.
It probably comes down to the roundtrip which is happening in your case. Instead of going straight to the server, you are first being routed to the US, where the proxy then forwards the request back to New Zealand, only to have the response go back via the same route.
To confirm that, could you post the output of ping api.addy.co.nz?