<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Suryansh Chaudhary</title>
    <description>The latest articles on DEV Community by Suryansh Chaudhary (@dev_suryansh).</description>
    <link>https://dev.to/dev_suryansh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1257065%2Fbc0b85f1-1f88-4ce0-8502-dc9b6a457ffe.png</url>
      <title>DEV Community: Suryansh Chaudhary</title>
      <link>https://dev.to/dev_suryansh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dev_suryansh"/>
    <language>en</language>
    <item>
      <title>Why more download threads make your downloads slower (and how I fixed it)</title>
      <dc:creator>Suryansh Chaudhary</dc:creator>
      <pubDate>Mon, 29 Jun 2026 07:07:16 +0000</pubDate>
      <link>https://dev.to/dev_suryansh/why-more-download-threads-make-your-downloads-slower-and-how-i-fixed-it-1i37</link>
      <guid>https://dev.to/dev_suryansh/why-more-download-threads-make-your-downloads-slower-and-how-i-fixed-it-1i37</guid>
      <description>&lt;p&gt;There's a myth baked into almost every "download accelerator": open more connections, download faster. It's intuitive, and it's wrong for most of the modern web.&lt;/p&gt;

&lt;p&gt;I learned this the hard way building &lt;a href="https://github.com/Suryansh-Codes2209/Macget" rel="noopener noreferrer"&gt;MacGet&lt;/a&gt;, a free, open-source, native macOS download manager — and the fix turned into the most interesting part of the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: parallelism looks like an attack
&lt;/h2&gt;

&lt;p&gt;When you split a file into N chunks and open N HTTP-Range connections at once, a naive downloader assumes the server will happily serve all of them. Modern CDNs don't. To them, one IP suddenly opening 16 connections and pulling ranges looks exactly like leech/abuse behavior. So they fight back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TCP-RST&lt;/strong&gt; your connections after a few bytes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;throttle&lt;/strong&gt; your IP for a while&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;403&lt;/strong&gt; new requests outright&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is counterintuitive: crank the thread count up and your download gets &lt;em&gt;slower&lt;/em&gt;, or fails entirely. More threads ≠ more speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: discover each host's real capacity at runtime
&lt;/h2&gt;

&lt;p&gt;Instead of trusting a fixed thread count, MacGet's engine treats parallelism as something to &lt;em&gt;discover&lt;/em&gt; per host:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adaptive up-scaling.&lt;/strong&gt; Downloads start at 4 connections and probe upward one at a time, keeping each added connection only when aggregate throughput improves by ≥15%. So it climbs toward the host's real ceiling instead of guessing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Demotion on rejection.&lt;/strong&gt; When ≥4 chunk attempts fail without making progress inside a 10-second window the signal that the host is rejecting parallelism the engine halves its worker count, cancels the lowest-progress chunks, and carries on. It repeats until it stabilizes at a level the host actually allows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Per-host memory.&lt;/strong&gt; That learned cap is persisted (&lt;code&gt;host_caps.json&lt;/code&gt;). The next download from the same host starts at the right level — no rediscovery tax. Caps only ratchet downward.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Staggered spawns.&lt;/strong&gt; Workers start ~100ms apart, so anti-abuse middleboxes see a steady ramp instead of a SYN burst from one IP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Smart retry classification.&lt;/strong&gt; Permanent failures (401/403/404/410/451, range refusals, malformed responses) fail fast. Transient ones (mid-stream RSTs, server-side stream kills, 5xx) retry with full-jitter exponential backoff under a hard cap — and 429/503 honor the server's &lt;code&gt;Retry-After&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's also a macOS-specific gotcha: &lt;strong&gt;App Nap&lt;/strong&gt;. If you switch apps, macOS will happily throttle your "background" download into the ground. MacGet holds a &lt;code&gt;ProcessInfo&lt;/code&gt; activity assertion while any download runs, so the OS leaves it alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Killing the slow-chunk tail
&lt;/h2&gt;

&lt;p&gt;Even when a host allows N connections, fixed N-way chunking has a long tail: split a file into N equal pieces and the whole download waits on whichever piece landed on the slowest path. MacGet slices range-capable downloads into &lt;strong&gt;more pieces than workers&lt;/strong&gt; (8 MB target), and a finished worker immediately &lt;em&gt;steals&lt;/em&gt; the next&lt;br&gt;
outstanding piece. No worker sits idle while another grinds through the tail.&lt;/p&gt;
&lt;h2&gt;
  
  
  How it's built
&lt;/h2&gt;

&lt;p&gt;The engine is modeled with Swift's actor concurrency, which made the&lt;br&gt;
correctness story dramatically easier than locks-and-queues would have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DownloadEngine (actor)
  └─ DownloadCoordinator (actor)   // one per download: probe → plan → stream → finalize
       ├─ ChunkWorker              // one HTTP-Range request, streamed via AsyncThrowingStream
       └─ FileWriter (actor)       // serializes positional writes so chunks don't race
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few more design notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Probe first.&lt;/strong&gt; A HEAD request (falling back to &lt;code&gt;GET Range: bytes=0-0&lt;/code&gt;, since some servers 405 on HEAD) establishes size, &lt;code&gt;Accept-Ranges&lt;/code&gt;, &lt;code&gt;ETag&lt;/code&gt;, and &lt;code&gt;Last-Modified&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP/3 when offered.&lt;/strong&gt; Requests opt into QUIC via &lt;code&gt;assumesHTTP3Capable&lt;/code&gt;, with graceful fallback to HTTP/2 → HTTP/1.1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integrity at finalize.&lt;/strong&gt; SHA-256 / MD5 is verified before the partial is promoted to the final filename; a mismatch fails the download and keeps the partial instead of handing you a corrupt file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sparse partials.&lt;/strong&gt; The partial file is &lt;code&gt;truncate&lt;/code&gt;d to full size up front; APFS keeps it sparse until bytes actually land.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resumable across restarts.&lt;/strong&gt; Per-chunk byte offsets are persisted, and workers send the recorded &lt;code&gt;ETag&lt;/code&gt;/&lt;code&gt;Last-Modified&lt;/code&gt; as &lt;code&gt;If-Range&lt;/code&gt; so a file that changed server-side fails fast instead of silently corrupting your partial.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Survives a dropped connection.&lt;/strong&gt; An &lt;code&gt;NWPathMonitor&lt;/code&gt; pauses active downloads on network loss ("Waiting for network…") and auto-resumes when it's back, instead of burning retries through an outage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Live speed/ETA.&lt;/strong&gt; A 3-second rolling window over &lt;code&gt;(time, bytes)&lt;/code&gt; samples; ETA goes &lt;code&gt;nil&lt;/code&gt; below 1 KB/s instead of lying to you.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole thing is SwiftUI on top, with &lt;code&gt;@Observable&lt;/code&gt; view models draining an &lt;code&gt;AsyncStream&lt;/code&gt; of engine events — the UI never mutates download state directly, only through the engine actor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond the engine
&lt;/h2&gt;

&lt;p&gt;The latest release (1.2) builds a real download manager around that core:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Video &amp;amp; audio downloads.&lt;/strong&gt; A conservative host classifier routes known video/audio sites to a bundled yt-dlp + ffmpeg extractor (with a quality/format picker); ordinary links still download as plain HTTP through the engine above.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authenticated downloads.&lt;/strong&gt; A Keychain-backed credential store answers Basic/Digest/NTLM challenges and remembers them per host across launches.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A browser extension&lt;/strong&gt; (Chrome/Edge/Brave/Firefox) that hands off downloads you start in the browser — carrying the cookies, referrer, and user-agent — so logged-in downloads actually work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Auto-sort&lt;/strong&gt; finished files into category folders, &lt;strong&gt;High/Normal/Low priorities&lt;/strong&gt;, &lt;strong&gt;bandwidth throttling&lt;/strong&gt;, and &lt;strong&gt;signed auto-updates&lt;/strong&gt; via Sparkle (EdDSA-verified — a tampered update is rejected).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Just want to use it?&lt;/strong&gt; Download the DMG: &lt;a href="https://suryansh.work/macget" rel="noopener noreferrer"&gt;https://suryansh.work/macget&lt;/a&gt; (free, un-notarized — right-click → Open on first launch for the one-time Gatekeeper step).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Want to read or hack the code?&lt;/strong&gt; It's MIT licensed and the engine is genuinely fun to poke at: &lt;a href="https://github.com/Suryansh-Codes2209/Macget" rel="noopener noreferrer"&gt;https://github.com/Suryansh-Codes2209/Macget&lt;/a&gt; — clone, open &lt;code&gt;Macget.xcodeproj&lt;/code&gt;, ⌘R. No setup.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>macos</category>
      <category>swift</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Unleashing the Power of Django on AWS: Best Practices for Seamless Deployment!</title>
      <dc:creator>Suryansh Chaudhary</dc:creator>
      <pubDate>Tue, 30 Jan 2024 04:48:26 +0000</pubDate>
      <link>https://dev.to/dev_suryansh/unleashing-the-power-of-django-on-aws-best-practices-for-seamless-deployment-53n</link>
      <guid>https://dev.to/dev_suryansh/unleashing-the-power-of-django-on-aws-best-practices-for-seamless-deployment-53n</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hey Dev Community! 💻 Excited to share some golden nuggets on deploying Django web apps on AWS. Let's make your deployment journey smoother with these best practices:&lt;br&gt;
**&lt;br&gt;
**AWS App Runner Magic:&lt;/strong&gt; Dive into the simplicity of deploying and scaling Django apps on AWS App Runner. Check out this AWS blog for a quick guide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Elastic Beanstalk Brilliance:&lt;/strong&gt; Discover the art of deploying Django apps on Elastic Beanstalk with AWS's official guide here. It's like a magic wand for streamlined deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kubernetes Mastery:&lt;/strong&gt; Elevate your Django deployment game by containerizing with Kubernetes. Explore the scalability and security in this DigitalOcean tutorial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL Power:&lt;/strong&gt; Level up your Django app by integrating PostgreSQL on AWS Elastic Beanstalk. Learn the ropes in this insightful Real Python tutorial.&lt;/p&gt;

&lt;p&gt;Remember, the key to a successful deployment is a mix of AWS services tailored to your app's needs. Keep it efficient, keep it scalable! 🔗✨&lt;/p&gt;

&lt;h1&gt;
  
  
  Django #AWS #DevOps #DeploymentMastery
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>cloud</category>
      <category>aws</category>
      <category>django</category>
    </item>
    <item>
      <title>AWS Elastic Beanstalk: ⚡Simplifying Web Application Deployment and Scaling</title>
      <dc:creator>Suryansh Chaudhary</dc:creator>
      <pubDate>Mon, 15 Jan 2024 11:34:02 +0000</pubDate>
      <link>https://dev.to/dev_suryansh/aws-elastic-beanstalk-simplifying-web-application-deployment-and-scaling-4jfm</link>
      <guid>https://dev.to/dev_suryansh/aws-elastic-beanstalk-simplifying-web-application-deployment-and-scaling-4jfm</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F67lh8abvb0gthwhrcjkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F67lh8abvb0gthwhrcjkl.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;AWS Elastic Beanstalk is a fully managed service that streamlines the deployment and scaling of web applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Easy Deployment:&lt;/strong&gt; Simply upload your code, and Elastic Beanstalk takes care of the deployment process. It eliminates the need for manual intervention in tasks like capacity provisioning and configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic Scaling:&lt;/strong&gt; Elastic Beanstalk dynamically scales your application based on demand. It leverages Auto Scaling, ensuring that your application can handle varying traffic loads efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Load Balancing:&lt;/strong&gt; The service includes Elastic Load Balancing, distributing incoming traffic across multiple instances to enhance application availability and fault tolerance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Health Monitoring:&lt;/strong&gt; Elastic Beanstalk continuously monitors the health of your application. It automatically replaces unhealthy instances, ensuring high availability and reliability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traffic-Splitting Deployments:&lt;/strong&gt; With features like traffic-splitting deployments, Elastic Beanstalk minimizes downtime by creating a new set of instances for updates while preserving the existing environment.&lt;/p&gt;

&lt;p&gt;In summary, AWS Elastic Beanstalk abstracts the complexities of infrastructure management, allowing developers to focus on building robust applications without worrying about the intricacies of deployment, scaling, and monitoring.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>devops</category>
      <category>student</category>
    </item>
    <item>
      <title>Launching 🚀Your AWS Application Journey with EC2: A Student's Guide⚡</title>
      <dc:creator>Suryansh Chaudhary</dc:creator>
      <pubDate>Mon, 15 Jan 2024 11:13:24 +0000</pubDate>
      <link>https://dev.to/dev_suryansh/launching-your-aws-application-journey-with-ec2-a-students-guide-35o</link>
      <guid>https://dev.to/dev_suryansh/launching-your-aws-application-journey-with-ec2-a-students-guide-35o</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hs4zp0ui2hh5kcg5i5m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hs4zp0ui2hh5kcg5i5m.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Are you a student eager to embark on your AWS application journey? Start by mastering Amazon EC2, a fundamental service that provides virtual machines in the cloud. Here's a step-by-step guide to kickstart your production-making adventure:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set Up Your AWS Account&lt;/strong&gt;:&lt;br&gt;
Begin by creating an AWS account. Follow the official guide to ensure a seamless setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Launch Your First EC2 Instance:&lt;/strong&gt;&lt;br&gt;
Learn the basics of launching an EC2 instance with this tutorial. Choose an Amazon Machine Image (AMI), select an instance type, and configure your settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understand Virtual Machines:&lt;/strong&gt;&lt;br&gt;
Delve into the world of virtualization. Understand how EC2 instances function as virtual machines, providing scalable computing power for your applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explore CodeDeploy for Deployments:&lt;/strong&gt;&lt;br&gt;
Familiarize yourself with CodeDeploy, a service that automates application deployments. Follow this guide for deployments on EC2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhance Security with Security Groups:&lt;/strong&gt;&lt;br&gt;
Master the art of managing security groups to secure your EC2 instances. Follow best practices outlined in the official documentation.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
