<?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[Stories by Guillaume Khayat on Medium]]></title>
        <description><![CDATA[Stories by Guillaume Khayat on Medium]]></description>
        <link>https://medium.com/@meego?source=rss-6a2a38f442c9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*ZKYrptWAdB8QWFp_IgPnsw.jpeg</url>
            <title>Stories by Guillaume Khayat on Medium</title>
            <link>https://medium.com/@meego?source=rss-6a2a38f442c9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 12:32:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meego/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Quick benchmarking of the AWS Graviton2 for Node.js applications]]></title>
            <link>https://medium.com/@meego/quick-benchmarking-of-the-aws-graviton2-for-node-js-applications-1ffb78992acc?source=rss-6a2a38f442c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ffb78992acc</guid>
            <category><![CDATA[arm]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[graviton]]></category>
            <dc:creator><![CDATA[Guillaume Khayat]]></dc:creator>
            <pubDate>Thu, 14 May 2020 13:38:16 GMT</pubDate>
            <atom:updated>2020-05-14T13:58:09.295Z</atom:updated>
            <content:encoded><![CDATA[<h3>Quick benchmark of the AWS Graviton2 for Node.js applications</h3><p><em>Foreword: the following tests should be taken with a grain of salt. Proper benchmarking requires a carefully crafted methodology, and re-running tests several times over. I did none of those for lack of time.</em></p><h3>tl;dr</h3><p><strong>For Node.js applications, Graviton2-powered m6g instances are slightly slower but more cost-effective than equivalent x86 instances. The difference for both metrics is very small (≈5%).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JvWn_W0ni_yhw6XJnSfY2g.png" /></figure><h3>Context</h3><p>On May 11, AWS’s news m6g instances have <a href="https://aws.amazon.com/blogs/aws/new-m6g-ec2-instances-powered-by-arm-based-aws-graviton2/">exited private beta and are now globally available</a>. These instances are powered by the AWS Graviton2, a 64-bit ARM CPU designed internally at Amazon and manufactured by TMSC on their 7nm process. Anandtech published a great <a href="https://www.anandtech.com/show/15578/cloud-clash-amazon-graviton2-arm-against-intel-and-amd">in-depth review</a>.</p><p>This is exciting because ARM processors have made tremendous progress over the last years and are now approaching desktop-class performance, but for a fraction of the cost of an Intel processor. With the the Graviton2 processor, here is what AWS is telling us to expect:</p><blockquote>For those of you running typical open-source application stacks, […] migrating to <a href="https://aws.amazon.com/ec2/graviton/">Graviton2</a>-based instances will give you <strong>up to 40% improvement on cost-performance ratio</strong>, compared to similar-sized M5 instances.</blockquote><p>Note that this 40% improvement uses Intel Xeon-powered m5 instances as a baseline. Those are manufactured with an older 10nm process, compared to the Graviton2’s 7nm process. <strong>A comparison with the AMD EPYC-powered m5a instances, which use the same 7nm process would have been less flattering, but much more relevant.</strong> Anyway, we’ll use these m5a instances for our benchmark.</p><h3>Setup</h3><p>We spawn 2 instances with Ubuntu 20.04 LTS :</p><ul><li>a <strong>m5a.xlarge</strong> as baseline. It‘s powered by a x86–64 Intel Xeon, 4vCPU, 16GB, costing $0.192/hour</li><li>a <strong>m6g.xlarge</strong>. It‘s powered by a aarch64 AWS Graviton2, 4vCPU, 16GB, costing $0.172/hour</li></ul><p>We install Node.js 10 LTS (v10.19.0) from repository</p><pre>apt-get install nodejs</pre><p>We download the <a href="https://github.com/nodejs/node/">Node.js source</a>. The <a href="https://github.com/nodejs/node/tree/master/benchmark">/benchmark</a> folder contains the project’s official performance regression test suite.</p><pre>git clone <a href="https://github.com/nodejs/node.git">https://github.com/nodejs/node.git</a><br>cd node<br>git checkout tags/v10.19.0</pre><h3>Test 1: Running the official Node.js benchmark suite</h3><p>We run the following command. To learn more about Node.js benchmarking, checkout this <a href="https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md">documentation</a>.</p><pre>time node benchmark/run.js assert buffers crypto process path string_decoder util v8 zlib</pre><p>This yields the following results:</p><ul><li><strong>m5a.xlarge: </strong>7041 seconds to complete. At $0.192/hour, running that benchmark cost us $0.376.</li><li><strong>m6g.xlarge: </strong>7476 seconds to complete. At $0.172/hour, running that benchmark cost us $0.357.</li></ul><p>Observations :</p><ul><li><strong>the Graviton2 instance was slightly slower.</strong> It took 6.2% more time to complete the benchmark.</li><li><strong>the Graviton2 instance was slightly more cost-effective.</strong> It cost 4.9% less to complete the benchmark.</li><li>AWS has some <a href="https://github.com/aws/aws-graviton-gettting-started">recommandations</a> for optimally compiling binaries for Graviton2. It’s very likely Ubuntu’s amd64 Node.js package does not use any of those. It would be interesting to re-run the benchmark with a binary that’s fine-tuned for AWS’s processor. Please let me know if you do!</li></ul><h3>Test 2: Compiling Node.js</h3><p>We run the following command:</p><pre>apt-get install make g++ python<br>./configure<br>time make -j8</pre><p>This yields the following results:</p><ul><li><strong>m5a.xlarge: </strong>1531 seconds to complete. At $0.192/hour, running that benchmark cost us $0.082.</li><li><strong>m6g.xlarge: </strong>863 seconds to complete. At $0.172/hour, running that benchmark cost us $0.041.</li></ul><p>Observations :</p><ul><li><strong>the Graviton2 instance was <em>much</em> faster.</strong> It took 43.7% less time to complete the benchmark.</li><li><strong>the Graviton2 instance was <em>much</em> more cost-effective.</strong> It cost 50% less to complete the benchmark.</li></ul><p>This is an impressive improvement but I’m not sure this was a valid test case. Maybe compiling to RISC machine code is inherently faster than compiling to CISC machine code. I don’t know. If you can shed some light on these results, please let me know in the comments.</p><h3>Credits</h3><p>Much appreciation to Vladimir de Turckheim and Jean Dupouy from the amazing <a href="http://francejs.org/">FranceJS</a> community for their help while doing these tests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ffb78992acc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disabling auto-retries in AWS Lambda]]></title>
            <link>https://medium.com/@meego/disable-auto-retries-in-aws-lambda-4443cb18fde4?source=rss-6a2a38f442c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4443cb18fde4</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Guillaume Khayat]]></dc:creator>
            <pubDate>Thu, 03 Aug 2017 11:15:32 GMT</pubDate>
            <atom:updated>2019-11-26T17:04:31.047Z</atom:updated>
            <content:encoded><![CDATA[<p>Microservices are great for some workflows. At <a href="http://www.spectre-music.com/">Spectre</a>, we use it for periodic high-concurrency compute jobs, processing thousands of media files. In that area, Amazon offers a pretty decent solution with <a href="http://microservices/Functions-as-a-service">AWS Lambda</a>. However, Lambda <a href="http://searchaws.techtarget.com/tip/Tricks-to-dodge-common-AWS-Lambda-problems">has</a> <a href="http://docs.aws.amazon.com/lambda/latest/dg/limits.html">a</a> <a href="https://aws.amazon.com/blogs/compute/getting-nodejs-and-lambda-to-play-nicely/">few</a> <a href="http://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html">quirks</a> that can range from midly annoying to downright frustrating.</p><p>One of those is Lambda’s insistance on automatically retrying failed invokations triggered from “asynchronous invocations” (e.g. S3).</p><p>Until the Lambda team gives us some kind of environment variable or setting to disable auto retries, here is a bit of code you can use in your Node Lambdas to mitigate this behaviour:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2c17effa2c69f955290bb3b091baaef/href">https://medium.com/media/c2c17effa2c69f955290bb3b091baaef/href</a></iframe><p>This code actually leverages Lambda’s quirks to make sure retried Lambda are aborted <em>as soon as possible</em>. It works because :</p><ul><li>Lambda not only reuses containers, <strong>it reuses whole Node processes</strong>, keeping global variables instanced and reusable. Useful for caching. Not so much for security and deterministic behaviour.</li><li>Retried lambdas share the same request Id (e.g. 63f33da6–7833–11e7-a7a4–0badbb709c07)</li></ul><p><strong>Edit (2019–11–25):</strong> AWS has finally announced a new “Maximum Retry Attempts” setting which makes it possible to disable auto-retries (source: <a href="https://aws.amazon.com/about-aws/whats-new/2019/11/aws-lambda-supports-max-retry-attempts-event-age-asynchronous-invocations/">https://aws.amazon.com/about-aws/whats-new/2019/11/aws-lambda-supports-max-retry-attempts-event-age-asynchronous-invocations/</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4443cb18fde4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>