<?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: Karan Padhiyar</title>
    <description>The latest articles on DEV Community by Karan Padhiyar (@karan2598).</description>
    <link>https://dev.to/karan2598</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%2F3905722%2F5dfc01f9-07e3-42a3-ae94-0614468cfe6a.jpg</url>
      <title>DEV Community: Karan Padhiyar</title>
      <link>https://dev.to/karan2598</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karan2598"/>
    <language>en</language>
    <item>
      <title>The Debugging Approach That Saved a Deployment</title>
      <dc:creator>Karan Padhiyar</dc:creator>
      <pubDate>Wed, 06 May 2026 07:36:52 +0000</pubDate>
      <link>https://dev.to/karan2598/the-debugging-approach-that-saved-a-deployment-2h3i</link>
      <guid>https://dev.to/karan2598/the-debugging-approach-that-saved-a-deployment-2h3i</guid>
      <description>&lt;p&gt;We had a rollout where requests in one client environment started timing out under load.&lt;/p&gt;

&lt;p&gt;Not locally. Not in staging. Only in their infra.&lt;/p&gt;

&lt;p&gt;At first, everything looked normal. No crashes. No clear errors. Just slow requests piling up until the system started struggling.&lt;/p&gt;

&lt;p&gt;The obvious move would have been to add more logs and redeploy.&lt;/p&gt;

&lt;p&gt;We didn’t do that.&lt;/p&gt;

&lt;p&gt;When your system runs continuously, every redeploy is a risk. You don’t push changes blindly. You need to understand the problem before touching anything.&lt;/p&gt;

&lt;p&gt;So instead of changing code, we changed how we looked at the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start With One Request
&lt;/h2&gt;

&lt;p&gt;Instead of scanning logs randomly, we focused on a single request and followed it through the system.&lt;/p&gt;

&lt;p&gt;That changed everything.&lt;/p&gt;

&lt;p&gt;What we saw was simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The API received the request instantly
&lt;/li&gt;
&lt;li&gt;An internal service call was taking several seconds
&lt;/li&gt;
&lt;li&gt;The downstream AI layer was fast
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the problem wasn’t external. It was inside our own system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Break Down the Time
&lt;/h2&gt;

&lt;p&gt;Looking at request-level logs wasn’t enough.&lt;/p&gt;

&lt;p&gt;We needed to know where time was actually being spent.&lt;/p&gt;

&lt;p&gt;Once we broke things down step by step, the issue became clear.&lt;/p&gt;

&lt;p&gt;A database operation that normally takes milliseconds was taking multiple seconds under load.&lt;/p&gt;

&lt;p&gt;No errors. Just delay.&lt;/p&gt;

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

&lt;p&gt;This wasn’t a slow query problem.&lt;/p&gt;

&lt;p&gt;It was a resource problem.&lt;/p&gt;

&lt;p&gt;The database connection pool was getting exhausted.&lt;/p&gt;

&lt;p&gt;In this client environment, the limits were lower than what we had assumed. Under load, requests weren’t failing. They were waiting.&lt;/p&gt;

&lt;p&gt;That’s why nothing looked broken. Everything was just slow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing It the Right Way
&lt;/h2&gt;

&lt;p&gt;We could have increased the connection pool size and moved on.&lt;/p&gt;

&lt;p&gt;That would have created new problems later.&lt;/p&gt;

&lt;p&gt;Instead, we changed how the system handled load.&lt;/p&gt;

&lt;p&gt;We limited how many requests could run at the same time.&lt;br&gt;&lt;br&gt;
We added control so requests didn’t pile up endlessly.&lt;br&gt;&lt;br&gt;
We made the system aware of environment limits instead of assuming defaults.&lt;/p&gt;

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

&lt;p&gt;After that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requests stopped piling up
&lt;/li&gt;
&lt;li&gt;Latency stayed stable under load
&lt;/li&gt;
&lt;li&gt;No infrastructure changes were needed from the client
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Actually Worked
&lt;/h2&gt;

&lt;p&gt;The fix wasn’t adding more logs.&lt;/p&gt;

&lt;p&gt;It wasn’t redeploying faster.&lt;/p&gt;

&lt;p&gt;It was understanding the system properly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track one request completely
&lt;/li&gt;
&lt;li&gt;Measure time at each step
&lt;/li&gt;
&lt;li&gt;Find the real bottleneck before changing anything
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When your system runs 24/7, debugging is different.&lt;/p&gt;

&lt;p&gt;You don’t guess.&lt;/p&gt;

&lt;p&gt;You prove where the problem is, and then you fix only that.&lt;/p&gt;




</description>
      <category>backend</category>
      <category>brainpackai</category>
      <category>performance</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>WebSockets + AI pipelines - why real-time AI breaks more than you expect</title>
      <dc:creator>Karan Padhiyar</dc:creator>
      <pubDate>Fri, 01 May 2026 09:41:31 +0000</pubDate>
      <link>https://dev.to/karan2598/websockets-ai-pipelines-why-real-time-ai-breaks-more-than-you-expect-18n2</link>
      <guid>https://dev.to/karan2598/websockets-ai-pipelines-why-real-time-ai-breaks-more-than-you-expect-18n2</guid>
      <description>&lt;p&gt;Real-time AI feels simple when you use it.&lt;/p&gt;

&lt;p&gt;You type something - it responds instantly.&lt;br&gt;&lt;br&gt;
You ask a question - it streams the answer live.  &lt;/p&gt;

&lt;p&gt;From the outside, it looks smooth. Almost effortless.&lt;/p&gt;

&lt;p&gt;But that experience hides a different reality.&lt;/p&gt;




&lt;p&gt;Most systems on the internet are short-lived.&lt;/p&gt;

&lt;p&gt;You send a request.&lt;br&gt;&lt;br&gt;
You get a response.&lt;br&gt;&lt;br&gt;
The connection ends.&lt;/p&gt;

&lt;p&gt;Real-time AI doesn’t behave like that.&lt;/p&gt;

&lt;p&gt;The connection stays open.&lt;br&gt;&lt;br&gt;
The system keeps running.&lt;br&gt;&lt;br&gt;
The response is not a single event - it’s a continuous flow.&lt;/p&gt;

&lt;p&gt;That small difference changes how everything works underneath.&lt;/p&gt;




&lt;p&gt;Now think about normal user behavior.&lt;/p&gt;

&lt;p&gt;People close tabs randomly.&lt;br&gt;&lt;br&gt;
Internet drops without warning.&lt;br&gt;&lt;br&gt;
Apps get minimized mid-response.  &lt;/p&gt;

&lt;p&gt;Nothing unusual.&lt;/p&gt;

&lt;p&gt;But the system doesn’t always know that the user is gone.&lt;/p&gt;

&lt;p&gt;So it keeps going.&lt;/p&gt;

&lt;p&gt;The AI keeps generating.&lt;br&gt;&lt;br&gt;
The backend keeps processing.&lt;br&gt;&lt;br&gt;
Resources keep getting used for something no one will ever see.&lt;/p&gt;




&lt;p&gt;This is where things start to matter.&lt;/p&gt;

&lt;p&gt;AI responses are not cheap.&lt;/p&gt;

&lt;p&gt;Every response uses compute.&lt;br&gt;&lt;br&gt;
Every second of processing has a cost.  &lt;/p&gt;

&lt;p&gt;If even a small percentage of users leave mid-way, the system starts doing unnecessary work at scale.&lt;/p&gt;

&lt;p&gt;You don’t notice it immediately.&lt;/p&gt;

&lt;p&gt;There’s no sudden crash.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;performance slowly drops
&lt;/li&gt;
&lt;li&gt;costs quietly increase
&lt;/li&gt;
&lt;li&gt;behavior becomes inconsistent
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s harder to detect and harder to fix.&lt;/p&gt;




&lt;p&gt;Real-time AI is not just a feature.&lt;/p&gt;

&lt;p&gt;It’s a continuous system.&lt;/p&gt;

&lt;p&gt;You’re not just answering users anymore.&lt;br&gt;&lt;br&gt;
You’re maintaining a live interaction that can break at any moment.&lt;/p&gt;

&lt;p&gt;And when it breaks, it often doesn’t tell you.&lt;/p&gt;




&lt;p&gt;That’s the gap most people underestimate.&lt;/p&gt;

&lt;p&gt;The difference between something that works once and something that keeps working all the time.&lt;/p&gt;

&lt;p&gt;A demo shows the experience.&lt;/p&gt;

&lt;p&gt;A real system deals with everything that interrupts that experience.&lt;/p&gt;




&lt;p&gt;Real-time AI feels instant.&lt;/p&gt;

&lt;p&gt;But what really defines it is not speed.&lt;/p&gt;

&lt;p&gt;It’s how the system behaves when the user disappears.&lt;/p&gt;




</description>
      <category>brainpackai</category>
      <category>aiinfrastructure</category>
      <category>realtimeai</category>
      <category>websystems</category>
    </item>
  </channel>
</rss>
