blog に戻る

2021年01月21日 Swaathi Kakarla

Best practices to monitor Cloudflare performance

If you’re a product on the web, you have less than a second to impress your customers. Web application performance is crucial to the success of online products. Using a Content Delivery Network (CDN) like Cloudflare can provide just the edge you need.

What is Cloudflare?

Cloudflare is a web infrastructure and security platform that provides a multitude of services; the primary one being a CDN and having one of the world’s largest networks. Cloudflare can help you improve global availability and reduce page-load speeds to a great extent.

If you have an internet presence, you need Cloudflare. As your business grows and you start attracting more visitors, you don’t want to go one step forward and two steps back with website crashes. With Cloudflare’s Load Balancing Analytics, you get granular data on where traffic is flowing and where latency trends are happening.

Cloudflare also offers a kind of firewall-as-a-service by protecting your website from malicious activity like DDoS attacks, malicious bots, and other nefarious intrusions.

How Does Cloudflare Work?

When a website is loaded, the request goes from your computer to the server and then returns the page. However, if too many requests are sent, the server gets overwhelmed and “crashes.” There are different ways to handle this. You can amp up your server army or cache pages and then render them. All these require a significant dev effort.

There’s an easier way – Cloudflare. With Cloudflare’s CDN and its powerful edge network, you can provide content and other services as close to your users as possible, so they get the information as fast as possible. Cloudflare's services sit between a website's visitor and the Cloudflare user's hosting provider, acting as a reverse proxy for websites.

You can integrate Cloudflare into your website today, even if you’re not a developer. It’s that easy – and free! However, if you are a developer, you can even run Javascript code right on the edge network and get even more control on what your user sees. This reduces delays and eliminates stale data being rendered.

What are the Benefits of Cloudflare?

Cloudflare isn’t just a CDN. It’s a one-stop-shop for all your distribution requirements. With Cloudflare, you get the added benefit of load balancing, security, and an ecosystem with built-in analytics and insights.

Security

Cloudflare’s layered security approach combines multiple DDoS mitigation capabilities into one service. It secures websites by preventing disruptions caused by bad traffic while ensuring the performance of legitimate traffic is not compromised. It’s so fast at detecting DDoS attacks that on average, nearly all are mitigated in three seconds!

Cloudflare’s built-in analytics give you deeper insights into your traffic patterns, threats observed (and blocked), and much more, right from the dashboard. You can even build custom monitoring systems with Cloudflare GraphQL API and Cloudflare logs.

While most security measures deal with detecting and confining risks, the best way is always to prevent them. Cloudflare provides free SSL/TLS certificates to encrypt all traffic communicating with your servers, and prevents data theft and tampering.

Cloudflare’s Bot Management helps you stop bad bots snooping your website by using threat intelligence at-scale. Using state-of-the-art behavioral analysis, machine learning and fingerprinting, Cloudflare will identify unauthorized bots that would otherwise abuse your website.

Load Balancing

As you add more servers to meet customer demands, you will soon uncover servers that are over-utilized or geographically distant. These often increase latency and degrade the user experience, resulting in lost customers, missed revenue, and reputational damage!

With Cloudflare Load Balancing, you can improve application performance and availability by steering traffic away from unhealthy origin servers and dynamically distributing it to the most available and responsive server pools.

You can manage global and local traffic in a complex infrastructure environment from one place — the Cloudflare Dashboard. The dashboard allows one place for all server information to be monitored so you can take actions immediately.

Unfortunately, unhealthy servers eventually die. When this inevitably happens, you need a fast failover, with zero downtime. As soon as an origin or pool goes down, requests proxied through Cloudflare get instantly re-routed — without waiting for TTLs to expire.

How Can I Monitor Cloudflare Performance?

On your path to integrating a CDN, ensure to set a protocol to measure, monitor and continuously improve performance. Let’s dive deep into the best practices to monitor Cloudflare performance for your website.

  1. Benchmark server against CDN performance – To ensure that load times decrease with the use of a CDN, compare performance with and without it.

  2. Monitor edge locations – CDNs allow you to reach more customers across the world. Monitor performance from the prime locations your customers are present in.

  3. Measure the number of trips to the origin server – The easiest way to decrease page load times is by caching the webpage. Measuring the number of trips to your origin reveals how well your CDN caches pages. To do this, simply read the value of the header, “CF-Cache-Status.” If it is a “HIT,” the page was cached; if it is a “MISS,” it’s not.

  4. Identify load times for individual page elements – A good CDN caches media content and allows for fast access from multiple locations. When measuring page-load times, tools often show the overall load times. But it is important to select tools that compare load times between plain HTML content and media content.

  5. Setup an Application Performance Monitoring (APM) tool – Using tools like Google Analytics, Google Lighthouse, NewRelic or AppDynamics allows you to measure unavailability, degraded performance, identity origin of errors, page visit break-down (such as location, user interest, or time), browser configurations and more. All these provide metrics to ensure health of your CDN.

Does Cloudflare Work With All Web-Based Application Platforms?

Cloudflare works for most websites, but takes configuration to allow some/all of Cloudflare products to be integrated into your website. The most basic and useful Cloudflare products such as the CDN and SSL/TLS support, can be added on without much dev effort.

However, for a truly seamless experience, we recommend building on top of the Cloudflare ecosystem. You can build serverless code that automatically scales, is widely available and exceptionally affordable. You can write code with JS, C, C++ and even Rust!

Is Cloudflare Useful to Integrate into My Web-Based Application?

Most people think scaling web applications means scaling servers on the cloud. While cloud computing offers more efficient resource management that helps improve compute performance, faster response times will only be felt by the end-user if servers are sitting as geographically close as possible. This is exactly where Cloudflare fits in.

Using both CDN and cloud computing strategies together helps to create a more resilient and reliable delivery strategy, that neither could do alone. This allows you to eliminate single points of failure by load balancing and traffic segregation while still making smart and efficient use of resources.

Cloudflare is a great tool for beginning websites that plan to scale up quickly into multiple places around the world.

Complete visibility for DevSecOps

Reduce downtime and move from reactive to proactive monitoring.

Sumo Logic cloud-native SaaS analytics

Build, run, and secure modern applications and cloud infrastructures.

Start free trial

Swaathi Kakarla

Swaathi Kakarla is the co-founder and CTO at Skcript. She enjoys talking and writing about code efficiency, performance, and startups. In her free time, she finds solace in yoga, bicycling and contributing to open source.

More posts by Swaathi Kakarla.

これを読んだ人も楽しんでいます