Explain CloudFlare

Started by Slip, Aug 08, 2022, 12:23 AM

Previous topic - Next topic

SlipTopic starter


I attempted to use Cloudflare but encountered an issue. The problem I encountered was that files not cached on Cloudflare experienced significant waiting times. I am unsure if I have configured Cloudflare incorrectly or if there is a solution to alleviate this issue.

After studying the trace, I was surprised to learn that anything uncached goes through the USA without exception. How can I verify this information by means other than the ping-admin service?

It seems that files such as js, css, jpg are provided from the nearest servers, while content from the original server (located in NYC, for example) has to pass through the USA before reaching the user. This causes a delay, which is undesirable when providing the first content as quickly as possible. While it is impressive that js, css, and jpg load quickly, the delay caused by traversing the ocean renders these loading times irrelevant.

My question is: why is this done, and how can non-cached content be delivered faster? Thank you.


Ping-Admin identifies countries based on IP addresses. Since CloudFlare's IPs originate from the US, Ping-Admin presents traffic as passing through the US. However, this display is not precise because the server may be located elsewhere despite the IP belonging to an American company, making it impossible to pinpoint the server's location.

The listed time on the table implies that the server is not in the USA since there would be a travel time of over 100ms between India and the US.

It's important to note that while tracing routes across the internet can help identify performance issues, it's not always possible to obtain precise information about a server's physical location. Other factors, such as network congestion or server configuration, may also contribute to slow loading times.


Cloudflare has announced its transition to using a Pingora proxy written in Rust for its content delivery network. The new proxy replaces the previous NGINX server-based configuration with Lua scripts and processes over one trillion requests per day. This implementation comes with several advantages, including new features and increased security due to secure memory handling. Most notably, the Pingora-based proxy consumes 70% less CPU resources and 67% less memory when processing traffic, thanks to the optimized Cloudflare architecture.

Previously, Cloudflare had been using an NGINX and Lua proxy system to proxy traffic, but with network growth and increased complexity, it had become insufficient, both in terms of performance and the need for extensibility and adding new customer features. Challenges included implementing functionality beyond gateway and load balancing, such as resending requests to another server when request processing fails, or providing a different set of HTTP headers.

Pingora uses a multithreaded model rather than a separation of requests by separate processing processes (worker). In Cloudflare's usage scenarios with high traffic from various sites, this approach shows a more efficient allocation of resources between CPU cores. Additionally, linking unbalanced requests to nginx processes led to an uneven CPU load, slowing down the processing of other requests. Moreover, connecting the connection pool to the handler processes resulted in an inability to reuse established connections of other handler processes, reducing work efficiency.

Overall, the transfer to Pingora is a significant step forward for Cloudflare in terms of performance and may result in further improvements and optimization in the future.


It's unfortunate to hear that you're experiencing delays with non-cached content on Cloudflare. Configuring Cloudflare correctly is crucial for optimal performance, so it's worth double-checking your settings.

Regarding your question about verifying information without relying on the ping-admin service, you can try using tools like traceroute or MTR (My TraceRoute) to analyze the routing path of your requests. These tools provide more detailed information about the network nodes your traffic passes through, helping you understand if requests are indeed going through the USA. You can run these commands from your machine's terminal or use online tools that provide similar functionalities.

As for the issue of non-cached content being delivered slower, it's important to understand how Cloudflare works. When a file is not cached on Cloudflare's servers, it needs to be fetched from the origin server (your NYC server, in this case). Depending on the network infrastructure and routing policies, the traffic may take longer to reach its destination, especially if it has to traverse long distances such as crossing an ocean.

To improve the delivery speed for non-cached content, consider the following:

1. Ensure your origin server is optimized: Make sure your server is configured for efficient handling of requests. This includes factors like server response times, network connectivity, and server location.

2. Utilize Cloudflare's Argo Smart Routing: Argo is a feature offered by Cloudflare that optimizes routing and performance for your content. It utilizes a private backbone to route traffic efficiently, potentially reducing latency and improving delivery times.

3. Consider using Cloudflare's Regional Traffic Manager: With this feature, you can customize the routing of traffic based on geographical regions. By directing requests to the nearest data centers, you can potentially reduce the delay caused by traversing long distances.

4. Optimize your website's content: To minimize the impact of delays when fetching non-cached content, optimize your website's code, files, and resources. This can include techniques like compressing files, minifying code, and leveraging browser caching wherever possible.

By implementing these strategies, you may be able to improve the delivery speed of non-cached content and reduce the delays you're experiencing.