<?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: sanjay yadav</title>
    <description>The latest articles on DEV Community by sanjay yadav (@sanjay_yadav_df9aa9af10ef).</description>
    <link>https://dev.to/sanjay_yadav_df9aa9af10ef</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3902053%2F5eec0c1c-b2bd-4bbf-bdd7-3ecb9bda5f10.png</url>
      <title>DEV Community: sanjay yadav</title>
      <link>https://dev.to/sanjay_yadav_df9aa9af10ef</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sanjay_yadav_df9aa9af10ef"/>
    <language>en</language>
    <item>
      <title>Why Your GKE Load Balancer Fails After 30 Seconds (Real Fix)</title>
      <dc:creator>sanjay yadav</dc:creator>
      <pubDate>Tue, 28 Apr 2026 10:12:08 +0000</pubDate>
      <link>https://dev.to/sanjay_yadav_df9aa9af10ef/why-your-gke-load-balancer-fails-after-30-seconds-real-fix-1j5g</link>
      <guid>https://dev.to/sanjay_yadav_df9aa9af10ef/why-your-gke-load-balancer-fails-after-30-seconds-real-fix-1j5g</guid>
      <description>&lt;p&gt;Still getting 504 errors in GKE even when everything looks fine?&lt;/p&gt;

&lt;p&gt;We faced the same issue. Pods were healthy, APIs were responding, and there were no errors in logs.&lt;/p&gt;

&lt;p&gt;The real problem wasn’t the application. It was a 30-second timeout.&lt;/p&gt;




&lt;p&gt;We spent hours debugging this.&lt;/p&gt;

&lt;p&gt;Everything looked normal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pods were running fine&lt;/li&gt;
&lt;li&gt;APIs were responding&lt;/li&gt;
&lt;li&gt;No crashes or error logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But still, requests kept failing.&lt;/p&gt;

&lt;p&gt;We were seeing random 503 and 504 errors.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Confusing Part
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Short requests worked perfectly&lt;/li&gt;
&lt;li&gt;Logs showed no issues&lt;/li&gt;
&lt;li&gt;System appeared healthy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But anything taking more than around 30 seconds failed every time.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We Thought Initially
&lt;/h2&gt;

&lt;p&gt;At first, we assumed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application bug&lt;/li&gt;
&lt;li&gt;Database latency&lt;/li&gt;
&lt;li&gt;Resource limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We checked everything. Nothing was wrong.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Cause
&lt;/h2&gt;

&lt;p&gt;After digging deeper, we found the actual issue:&lt;/p&gt;

&lt;p&gt;GKE Load Balancer has a default timeout of 30 seconds.&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your backend may still be processing&lt;/li&gt;
&lt;li&gt;But the load balancer stops waiting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Result: 504 Gateway Timeout.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix: BackendConfig
&lt;/h2&gt;

&lt;p&gt;We fixed it using BackendConfig.&lt;/p&gt;

&lt;p&gt;It allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increase timeout&lt;/li&gt;
&lt;li&gt;Customize health checks&lt;/li&gt;
&lt;li&gt;Control load balancer behavior&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What We Changed
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloud.google.com/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;BackendConfig&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-backend-config&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;timeoutSec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This change increased the timeout from 30 seconds to 60 seconds.&lt;/p&gt;

&lt;p&gt;After applying it, the issue was resolved.&lt;/p&gt;




&lt;h2&gt;
  
  
  Attach It to Your Service
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;cloud.google.com/backend-config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{"ports":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{"8003":"my-backend-config"}}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the configuration and redeploy your service.&lt;/p&gt;




&lt;h2&gt;
  
  
  Important Note
&lt;/h2&gt;

&lt;p&gt;If you don’t configure BackendConfig:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Default timeout remains 30 seconds&lt;/li&gt;
&lt;li&gt;Long-running requests will fail&lt;/li&gt;
&lt;li&gt;You have limited control over behavior&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Bonus Tip
&lt;/h2&gt;

&lt;p&gt;If your application regularly takes longer to respond:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid increasing timeout too much&lt;/li&gt;
&lt;li&gt;Consider using asynchronous processing (queues or background jobs)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;This was not a complex bug.&lt;/p&gt;

&lt;p&gt;It was a default setting that we were not aware of.&lt;/p&gt;

&lt;p&gt;Sometimes the real issue is not in your code, but in infrastructure defaults.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://www.kubeblogs.com/fixing-504-errors-in-gke-load-balancer-how-backendconfig-solved-our-30-second-timeout-problem/" rel="noopener noreferrer"&gt;Full step-by-step guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you work with GKE, this can save you a lot of time.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>gcp</category>
      <category>devops</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Stop Using T2 Instances — They Cost More Than You Think (T2 vs T3)</title>
      <dc:creator>sanjay yadav</dc:creator>
      <pubDate>Tue, 28 Apr 2026 09:43:27 +0000</pubDate>
      <link>https://dev.to/sanjay_yadav_df9aa9af10ef/stop-using-t2-instances-they-cost-more-than-you-think-t2-vs-t3-4kcp</link>
      <guid>https://dev.to/sanjay_yadav_df9aa9af10ef/stop-using-t2-instances-they-cost-more-than-you-think-t2-vs-t3-4kcp</guid>
      <description>&lt;h1&gt;
  
  
  Stop Using T2 Instances — They’re Quietly Increasing Your AWS Bill
&lt;/h1&gt;

&lt;p&gt;I used to think T2 instances were the cheapest option on AWS.&lt;/p&gt;

&lt;p&gt;They look affordable, they’re everywhere in tutorials, and honestly — most of us just start with them.&lt;/p&gt;

&lt;p&gt;But after checking a few AWS bills closely, I realized something wasn’t adding up.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤔 What’s Actually Going On with T2?
&lt;/h2&gt;

&lt;p&gt;T2 instances run on a CPU credit system.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When your app is idle → you earn credits
&lt;/li&gt;
&lt;li&gt;When CPU usage increases → you spend credits
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first, this seems like a smart system.&lt;/p&gt;

&lt;p&gt;But here’s the part most people miss 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  Where the Extra Cost Comes From
&lt;/h2&gt;

&lt;p&gt;If your instance runs out of CPU credits, AWS doesn’t just slow things down.&lt;/p&gt;

&lt;p&gt;If &lt;strong&gt;unlimited mode&lt;/strong&gt; is enabled (which it often is by default), you start getting charged for extra CPU usage.&lt;/p&gt;

&lt;p&gt;No clear warning. No obvious alert.&lt;/p&gt;

&lt;p&gt;Just a slightly higher bill at the end of the month.&lt;/p&gt;

&lt;p&gt;That’s exactly what happened to me.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I Switched to T3
&lt;/h2&gt;

&lt;p&gt;T3 instances are basically the improved version of T2.&lt;/p&gt;

&lt;p&gt;After switching, I noticed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More consistent performance
&lt;/li&gt;
&lt;li&gt;Fewer surprises in billing
&lt;/li&gt;
&lt;li&gt;Better overall value
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They use newer hardware and handle CPU usage more efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  T2 vs T3 (Simple View)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;T2&lt;/th&gt;
&lt;th&gt;T3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CPU Handling&lt;/td&gt;
&lt;td&gt;Credit-based&lt;/td&gt;
&lt;td&gt;Smarter credits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance&lt;/td&gt;
&lt;td&gt;Can drop&lt;/td&gt;
&lt;td&gt;More stable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pricing&lt;/td&gt;
&lt;td&gt;Can spike&lt;/td&gt;
&lt;td&gt;More predictable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generation&lt;/td&gt;
&lt;td&gt;Older&lt;/td&gt;
&lt;td&gt;Newer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  When You Should Avoid T2
&lt;/h2&gt;

&lt;p&gt;From experience, avoid T2 if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your app has traffic spikes
&lt;/li&gt;
&lt;li&gt;You're running anything close to production
&lt;/li&gt;
&lt;li&gt;You don’t want unpredictable costs
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick Tip
&lt;/h2&gt;

&lt;p&gt;If you're currently using T2, check this:&lt;/p&gt;

&lt;p&gt;Go to your billing dashboard → look for &lt;strong&gt;CPU credit charges&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might already be paying more than expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;T2 isn’t “bad” — it’s just outdated for most real use cases.&lt;/p&gt;

&lt;p&gt;T3 is usually the safer and smarter choice now.&lt;/p&gt;

&lt;p&gt;🔗 Full article: [&lt;a href="https://www.kubeblogs.com/why-t3-is-better-than-t2-for-most-aws-ec2-workloads/" rel="noopener noreferrer"&gt;https://www.kubeblogs.com/why-t3-is-better-than-t2-for-most-aws-ec2-workloads/&lt;/a&gt;]&lt;br&gt;
If you're into simple, practical DevOps tips, follow along 👍&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
