<?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 Sarad Mohanan on Medium]]></title>
        <description><![CDATA[Stories by Sarad Mohanan on Medium]]></description>
        <link>https://medium.com/@sarad.mohanan?source=rss-94ce1863d4a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7sDagFW4BLhXuKnOn80apw.jpeg</url>
            <title>Stories by Sarad Mohanan on Medium</title>
            <link>https://medium.com/@sarad.mohanan?source=rss-94ce1863d4a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:19:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sarad.mohanan/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[Network Throttling in AWS]]></title>
            <link>https://medium.com/hevo-data-engineering/network-throttling-in-aws-c4cd560d4aa3?source=rss-94ce1863d4a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4cd560d4aa3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[nat]]></category>
            <dc:creator><![CDATA[Sarad Mohanan]]></dc:creator>
            <pubDate>Mon, 17 May 2021 07:02:59 GMT</pubDate>
            <atom:updated>2021-05-17T08:17:53.670Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_FXWIXy3GZ64f837MSZ1dw.png" /></figure><p>At Hevo we use AWS EC2 to run all of our workloads. All the EC2 instances are located in a private VPC Subnet except for the NAT Gateway used to route the internet traffic from the private subnet. Initially, we were using an AWS NAT Gateway but soon it was adding a high cost to the usage, after evaluating the effort we decided to move on to a self-hosted NAT Gateway. After some quick testing, we concluded that a t3.small instance is good enough for a NAT Gateway, and in fact, it worked out fine for 6 months prior to the incident we would be discussing. This is a story about how we discovered network throttling on EC2 instances.</p><h3>Observation</h3><p>On the fine morning of 6th June of 2020, we observed that there are a high number of auto-scaled nodes in our India cluster and still there was a huge backlog of tasks. At the same time, I was asked to deploy a patch. I started with the deployment process and soon we noticed that our application binary was taking a lot more time than usual to be downloaded from our artifacts S3 located in North Virginia. In fact, it took us around 1 hour to just download the binary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JC7VwDnoo3WFQsF8" /><figcaption>task lag in India cluster</figcaption></figure><h3>Finding the root cause</h3><p>We were under the impression that there is some kind of throttling from S3. We started to look around the AWS docs about the rate-limiting in S3 and found out that we were way below the limits. So we decided to check the status page of AWS and even that was fine. Next, we tried to look at what happens when we do a <a href="https://en.wikipedia.org/wiki/Traceroute">Traceroute</a> to a random S3 region(Oregon) to check if the behavior is persistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qdXj44IH2sts03hb" /><figcaption>traceroute to us-west-2(Oregon) region</figcaption></figure><p>There was a visibly huge round trip time (RTT) in all of the trials and hops. So we decided to check with <a href="https://www.google.com/">google.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vep2f4kBRohXCoVt" /><figcaption>traceroute to google.com</figcaption></figure><p>We noticed that the first-hop was taking a huge time, and being the NAT instance and available in the local network, it should only take under the neighborhood of 0.1 milliseconds. That’s when we cornered the issue to the NAT instance and decided to review the network utilization of the instance and found out that it was flat-lining. So we decided to stop and start the NAT Instance and soon the results were visible. The network traffic was no longer being capped. The task backlog was also soon cleared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B7Gnymi80HU-agXf" /><figcaption>Network traffic was capped and later on restart, it recovered.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o9EaltbyaSimsp8y" /><figcaption>Backlog of tasks before and after the restart of NAT instance.</figcaption></figure><h3>Recreating the scenario</h3><p>To validate our hypothesis that EC2 caps the traffic, we created a 1 GB file and uploaded it to an S3 location half the way around the globe. We wrote a python script to download it multiple times and we saw that the network was actually being capped. We repeated the experiment with different instance types and found out that the Instance with better resources has more time before the network usage is capped while the resource utilization almost always stays the same. And unlike the CPU credit system in burstable EC2 instance(t*) the network usage is not reset after over-usage.</p><h3>Monitoring for the scenario</h3><p>To monitor the scenario, we run a cron every 1 hour to upload and download a 1GB file from a different S3 location then the NAT is located, and measure the time taken for both uploads as well as download.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4cd560d4aa3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hevo-data-engineering/network-throttling-in-aws-c4cd560d4aa3">Network Throttling in AWS</a> was originally published in <a href="https://medium.com/hevo-data-engineering">Hevo Data Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>