<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Ddosify - Medium]]></title>
        <description><![CDATA[Ddosify is a high-performance load testing solution. The mission of the Ddosify project is to create generic, no code and the most powerful load testing experience for developers, quality assurance engineers, and even non-technical people. - Medium]]></description>
        <link>https://medium.com/ddosify?source=rss----63d0f141830---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Ddosify - Medium</title>
            <link>https://medium.com/ddosify?source=rss----63d0f141830---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 18:56:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ddosify" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cold Start Comparison of AWS Lambda and Cloudflare Workers]]></title>
            <link>https://medium.com/ddosify/cold-start-comparison-of-aws-lambda-and-cloudflare-workers-a3f9021ee60a?source=rss----63d0f141830---4</link>
            <guid isPermaLink="false">https://medium.com/p/a3f9021ee60a</guid>
            <category><![CDATA[ddosify]]></category>
            <category><![CDATA[cold-start]]></category>
            <category><![CDATA[cloudflare-workers]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Fatih Baltaci]]></dc:creator>
            <pubDate>Fri, 06 May 2022 13:31:07 GMT</pubDate>
            <atom:updated>2024-01-10T20:52:22.964Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cold Start Comparison of AWS Lambda, Cloudflare Workers and AWS Cloudfront Function</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_DCQy059jjIfXJyrvFG2A.jpeg" /></figure><p>Many serverless platforms exist, such as AWS Lambda, Azure Functions, Google Cloud Functions, and Cloudflare Workers. Most serverless platforms spin up a container after the first request and use the same container for the following requests. After inactivity and a period, the container will be closed. Spinning up a container after a first request takes time, called the “<strong>cold start problem</strong>.”</p><p>To solve this famous <strong>cold start </strong>problem, Cloudflare designed a different approach, and they claim 0ms cold starts all around the world. Internally, Cloudflare Workers runtime uses the fast and powerful <strong>Chrome</strong> <strong>V8 Engine</strong> to run Javascript code. Each process is sandboxed using “<strong>isolates</strong>” so that the different users’ codes are run in a single process in an isolated and secure way. This reduces the overhead of processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_iot1z46IIPhcvYC.png" /><figcaption>Figure 1: Isolates Diagram. Ref: <a href="https://blog.cloudflare.com/containers-on-the-edge/">Cloudflare — Containers on the Edge</a></figcaption></figure><p>Cloudflare Workers functions are deployed on the global Edge Network in <strong>100+ </strong>countries and <strong>200+</strong> cities<strong> </strong>across the globe within seconds. Thanks to <a href="https://www.cloudflare.com/learning/cdn/glossary/anycast-network/">Anycast</a>, the incoming request will be routed to the nearest data center. Thus, despite the traditional serverless platforms, you don’t need to create a new endpoint for each location to achieve the same latency worldwide. And you shouldn’t face the cold start problem.</p><p>This article compares <strong>Cloudflare Workers</strong>, <strong>AWS Lambda</strong> and <a href="https://aws.amazon.com/blogs/aws/introducing-cloudfront-functions-run-your-code-at-the-edge-with-low-latency-at-any-scale/"><strong>AWS Cloudfront Function</strong></a> for cold start problems. While <a href="https://app.ddosify.com/">Ddosify Cloud</a> can send requests from 100+ countries, AWS Lambda region support is limited, so testing the latency in relatively high traffic worldwide wouldn’t be fair. For this reason, we decided to use only <strong>Europe </strong>as a request origin focusing on the cold-start problem.</p><h3><strong>Test Bed</strong></h3><p><strong>AWS Lambda</strong></p><p>On the AWS Lambda side, we created a basic Node.js 14.x that returns HTTP 200 for all the requests and enabled Function URL, a new feature you can call lambda without an API gateway. We changed the Auth type of the Function URL to None for public access. This serverless function is deployed in the <strong>Frankfurt (eu-central-1)</strong> region.</p><pre>exports.handler = async (event) =&gt; {<br>    const response = {<br>        statusCode: 200,<br>        body: JSON.stringify(&#39;Hello from AWS Lambda!&#39;),<br>    };<br>    return response;<br>};</pre><p><strong>Cloudflare Workers</strong></p><p>We created a basic HTTP Handler that returns HTTP 200 for all the requests on the Cloudflare Workers side. Cloudflare functions are deployed automatically across the world. We used the Free plan for Cloudflare Workers.</p><pre>addEventListener(&quot;fetch&quot;, event =&gt; {<br>  event.respondWith(handleRequest(event.request))<br>})<br>async function handleRequest(request) {<br>  return new Response(&quot;Hello from Cloudflare Workers!&quot;)<br>}</pre><p><strong>AWS Cloudfront Function</strong></p><p>We created a basic HTTP Handler that returns HTTP 200 for all the requests on the AWS Cloudfront Function side. CloudFront functions are deployed automatically across 200+ CloudFront Edge Locations.</p><pre>function handler(event) {<br>    var response = {<br>        statusCode: 200,<br>        statusDescription: &#39;OK&#39;,<br>    };<br>    return response;<br>}</pre><p>Now, we can generate requests for the AWS Lambda and Cloudflare Workers. We sent 10,000 requests linearly in 10 seconds (<strong>1,000 RPS</strong>) with the <a href="https://app.ddosify.com/"><strong>Ddosify Cloud</strong></a> load testing tool into both functions separately. Ddosify sent all the requests from 17 countries evenly from the European continent.</p><h3>Results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZdrTfN5FkFFDTOwLX9YQw.jpeg" /><figcaption>Figure 2: AWS Lambda vs. Cloudflare Workers vs. AWS Cloudfront Function cold start comparison. We sent 10,000 requests linearly in 10 seconds (1,000 RPS) using the Ddosify Cloud.</figcaption></figure><p>AWS Lambda, Cloudflare Worker and AWS Cloudfront function handled all requests without a problem. The results show that the AWS Cloudfront Function is better than the Cloudflare Worker and AWS Lambda on the response times side. The results are shown in Figure 2 and Table 1.</p><figure><img alt="AWS Lambda vs. Cloudflare Workers vs. AWS Cloudfront Function response times comparison using Ddosify Cloud." src="https://cdn-images-1.medium.com/max/1024/1*1zyekcZ2euYcfFnjYFjNZA.png" /><figcaption>Table 1: AWS Lambda vs. Cloudflare Workers vs. AWS Cloudfront Function response times (avg, max, min) comparison using Ddosify Cloud.</figcaption></figure><h3>Cold Start Comparison</h3><p>Since the Average calculation includes anomalies, we used the <strong>P90 Response Time </strong>metric to compare more accurately.</p><p>The AWS Lambda obtained <strong>333 </strong>ms response time on the <strong>P90 </strong>metric in the first second and <strong>217 </strong>ms after 3 seconds. P90 continued for about <strong>210</strong> ms after 3 seconds. 333 ms is not a big deal, but it is good to know that this result is the aggregated value of the 1K requests. You’ll see higher response times for the first individual requests.</p><p>The Cloudflare Workers obtained <strong>219 </strong>ms on the P90 metric in the first second and continued for about <strong>213 </strong>ms until the end of the load test.</p><p>The AWS Cloudfront Function obtained <strong>220 </strong>ms on the P90 metric in the first second and continued for about <strong>198 </strong>ms until the end of the load test.</p><p>These results show that there is still a <strong>cold start </strong>problem in the AWS Lambda. Cloudflare Workers and Cloudfront functions’ initial P90 response time is very similar to the response time until the end of the load test. According to the results, the Cloudflare Workers and AWS Cloudfront Function do not have a cold start problem. AWS Cloudfront function is also faster than Cloudflare Workers.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FAHDeD%2F3%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FAHDeD%2F3%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FAHDeD%2Fplain-s.png%3Fv%3D3&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="1078" height="848" frameborder="0" scrolling="no"><a href="https://medium.com/media/e957b72e5d7095094654dac4e8e9b068/href">https://medium.com/media/e957b72e5d7095094654dac4e8e9b068/href</a></iframe><h3>Summary</h3><p>We compared AWS Lambda, Cloudflare Workers, and AWS Cloudfront Function for the <strong>cold start</strong> problem. The results show that the AWS Lambda suffers from the well-known cold start problem. Even if we chose the Free plan for Cloudflare workers, we did not observe any cold start problems. We also observed no cold start problem in the AWS Cloudfront Function.</p><p>Cloudflare Workers is only part of the complete replacement for AWS Lambda. You can only use a few packages that require Node dependencies, like net/http in Cloudflare Workers because it is built on the V8 engine.</p><p><em>You can compare your serverless functions like AWS Lambda, Cloudflare Workers, Azure Functions, and Google Cloud Functions using </em><a href="https://app.ddosify.com/"><strong><em>Ddosify Cloud</em></strong></a><em>. You can see all the response times (i.e., Avg, Max, Min, P90, Stddev) and location statistics on a multi-location-based, open-source-centric, and codeless load testing platform.</em></p><p><strong>Cloudflare Workers:</strong> <a href="https://workers.cloudflare.com/">https://workers.cloudflare.com/</a></p><p><strong>AWS Lambda:</strong> <a href="https://aws.amazon.com/lambda/">https://aws.amazon.com/lambda/</a></p><p><strong>Ddosify:</strong> <a href="https://ddosify.com/">https://ddosify.com</a></p><p><strong>Follow me on Twitter:</strong> <a href="https://twitter.com/fatihbaltaci_">https://twitter.com/fatihbaltaci_</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3f9021ee60a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ddosify/cold-start-comparison-of-aws-lambda-and-cloudflare-workers-a3f9021ee60a">Cold Start Comparison of AWS Lambda and Cloudflare Workers</a> was originally published in <a href="https://medium.com/ddosify">Ddosify</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>