<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rust Deployment &amp; Operations on Atharva Pandey</title><link>https://atharva.page/series/rust-deployment--operations/</link><description>Recent content in Rust Deployment &amp; Operations on Atharva Pandey</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright ©</copyright><lastBuildDate>Thu, 08 May 2025 13:50:00 +0000</lastBuildDate><atom:link href="https://atharva.page/series/rust-deployment--operations/index.xml" rel="self" type="application/rss+xml"/><item><title>Lesson 8: Release Profiles and Build Optimization — Shipping fast binaries</title><link>https://atharva.page/post/rust/rust-deploy-release-profiles/</link><pubDate>Thu, 08 May 2025 13:50:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-release-profiles/</guid><description>&lt;p&gt;I was benchmarking two builds of the same service — one with default release settings, one with a tuned profile. Same code. Same hardware. The tuned build was 22% faster on our hot path and 40% smaller. I didn&amp;rsquo;t change a single line of Rust. Just &lt;code&gt;Cargo.toml&lt;/code&gt; settings.&lt;/p&gt;
&lt;p&gt;Most Rust developers know about &lt;code&gt;cargo build --release&lt;/code&gt;. Fewer know that &lt;code&gt;--release&lt;/code&gt; is just a starting point — there&amp;rsquo;s a whole set of knobs in the release profile that trade compile time for runtime performance, or binary size, or debuggability. Let me walk you through every one that matters.&lt;/p&gt;</description></item><item><title>Lesson 7: Configuration — Environment, files, feature flags</title><link>https://atharva.page/post/rust/rust-deploy-config/</link><pubDate>Mon, 05 May 2025 10:15:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-config/</guid><description>&lt;p&gt;I once shipped a service to production with the staging database URL hardcoded. Not in an environment variable — literally in the source code, in a &lt;code&gt;const&lt;/code&gt;. It ran for two hours writing production data to the staging database before anyone noticed. The fix was easy. The data migration to clean up the mess took three days.&lt;/p&gt;
&lt;p&gt;Configuration is one of those things that seems trivial until it bites you. And in Rust, we have the type system to make configuration bulletproof — but only if we structure things right. Let me walk you through the approach I&amp;rsquo;ve converged on after making every possible configuration mistake.&lt;/p&gt;</description></item><item><title>Lesson 6: Graceful Shutdown — Draining connections cleanly</title><link>https://atharva.page/post/rust/rust-deploy-graceful-shutdown/</link><pubDate>Fri, 02 May 2025 19:45:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-graceful-shutdown/</guid><description>&lt;p&gt;I deployed a new version of a payment service once, and for about 3 seconds during the rollout, a handful of transactions just&amp;hellip; vanished. They weren&amp;rsquo;t in the database. They weren&amp;rsquo;t in the error logs. The old pods received the requests, started processing them, and then Kubernetes killed the pods before they finished. SIGKILL doesn&amp;rsquo;t ask nicely — it just terminates the process. Those transactions were gone.&lt;/p&gt;
&lt;p&gt;Graceful shutdown is the solution. When your service receives SIGTERM (Kubernetes&amp;rsquo;s way of saying &amp;ldquo;please stop&amp;rdquo;), it should stop accepting new requests, finish processing in-flight requests, flush any buffered data, close connections cleanly, and &lt;em&gt;then&lt;/em&gt; exit. Get this right and you get zero-downtime deployments. Get it wrong and you get data loss.&lt;/p&gt;</description></item><item><title>Lesson 5: Health Checks and Readiness Probes — Production liveness</title><link>https://atharva.page/post/rust/rust-deploy-health-checks/</link><pubDate>Wed, 30 Apr 2025 14:05:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-health-checks/</guid><description>&lt;p&gt;A service I maintained once passed all its health checks while silently dropping 30% of incoming requests. The health endpoint returned 200 OK every time Kubernetes asked. The database connection pool was exhausted, the service couldn&amp;rsquo;t process anything, but that little &lt;code&gt;/health&lt;/code&gt; endpoint — which didn&amp;rsquo;t touch the database — happily reported everything was fine.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s when I learned the difference between a health check that checks health and one that just says &amp;ldquo;the process is running.&amp;rdquo; They&amp;rsquo;re very different things, and getting this wrong means your orchestrator keeps sending traffic to a broken instance instead of replacing it.&lt;/p&gt;</description></item><item><title>Lesson 4: Observability — tracing, metrics, OpenTelemetry</title><link>https://atharva.page/post/rust/rust-deploy-observability/</link><pubDate>Sun, 27 Apr 2025 08:22:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-observability/</guid><description>&lt;p&gt;I once spent six hours debugging a production issue where requests were randomly timing out. No errors in the logs. CPU and memory looked fine. Response times were normal — except for the 2% that took 30 seconds. Without distributed tracing, I was blind. I ended up bisecting the problem by adding &lt;code&gt;println!&lt;/code&gt; statements, deploying them one at a time, and watching CloudWatch. It was miserable.&lt;/p&gt;
&lt;p&gt;That experience permanently changed how I build services. Observability isn&amp;rsquo;t something you bolt on when things break. It&amp;rsquo;s something you build in from day one, or you pay for it later — with your time, your sleep, and your sanity.&lt;/p&gt;</description></item><item><title>Lesson 3: CI/CD for Rust — GitHub Actions, caching, cargo-nextest</title><link>https://atharva.page/post/rust/rust-deploy-ci/</link><pubDate>Thu, 24 Apr 2025 11:30:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-ci/</guid><description>&lt;p&gt;My first Rust CI pipeline took 45 minutes. Forty-five. Every push triggered a full dependency build, tests ran sequentially, and clippy ran as a separate job that also built everything from scratch. I was burning through GitHub Actions minutes like they were free — which they are for open source, but my patience certainly wasn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;Getting Rust CI right is mostly about caching. The compilation model means a clean build downloads and compiles hundreds of crates, and without caching, every single CI run pays that cost. Let me show you the pipeline I&amp;rsquo;ve landed on after iterating through dozens of projects.&lt;/p&gt;</description></item><item><title>Lesson 2: Static Linking with musl — Single binary deploys</title><link>https://atharva.page/post/rust/rust-deploy-static-linking/</link><pubDate>Tue, 22 Apr 2025 16:40:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-static-linking/</guid><description>&lt;p&gt;Last year I had to deploy a Rust service to a hardened environment — no package manager, no shared libraries, no internet access. Just a bare Linux kernel and my binary. If my binary depended on libc, libssl, or anything else in &lt;code&gt;/usr/lib&lt;/code&gt;, it simply wouldn&amp;rsquo;t start. That constraint forced me to learn static linking properly, and it turned out to be one of the best deployment patterns I&amp;rsquo;ve ever used.&lt;/p&gt;</description></item><item><title>Lesson 1: Docker for Rust — Multi-stage builds, minimal images</title><link>https://atharva.page/post/rust/rust-deploy-docker/</link><pubDate>Sun, 20 Apr 2025 09:15:00 +0000</pubDate><guid>https://atharva.page/post/rust/rust-deploy-docker/</guid><description>&lt;p&gt;The first time I shipped a Rust service in Docker, my image was 2.1 GB. Two. Point. One. Gigabytes. For a binary that was 8 MB. I&amp;rsquo;d used &lt;code&gt;rust:latest&lt;/code&gt; as my base, ran &lt;code&gt;cargo build --release&lt;/code&gt; inside it, and called it a day. The image had GCC, LLVM, every system library known to humanity, and my tiny HTTP server somewhere in the corner.&lt;/p&gt;
&lt;p&gt;That was the day I learned about multi-stage builds. And honestly, getting Docker right for Rust is one of those things that separates &amp;ldquo;I deployed it&amp;rdquo; from &amp;ldquo;I deployed it well.&amp;rdquo;&lt;/p&gt;</description></item></channel></rss>