<?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: Bigboss6797976</title>
    <description>The latest articles on DEV Community by Bigboss6797976 (@bigboss6797976).</description>
    <link>https://dev.to/bigboss6797976</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%2F3964888%2Fec6d92be-2a97-493a-93e0-f142116d3e0c.jpg</url>
      <title>DEV Community: Bigboss6797976</title>
      <link>https://dev.to/bigboss6797976</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bigboss6797976"/>
    <language>en</language>
    <item>
      <title>The 6-Hour Ghost: How I Exorcised a Cache Avalanche with Async Reconnection and a Bloom Filter</title>
      <dc:creator>Bigboss6797976</dc:creator>
      <pubDate>Wed, 15 Jul 2026 03:14:28 +0000</pubDate>
      <link>https://dev.to/bigboss6797976/the-6-hour-ghost-how-i-exorcised-a-cache-avalanche-with-async-reconnection-and-a-bloom-filter-4dfb</link>
      <guid>https://dev.to/bigboss6797976/the-6-hour-ghost-how-i-exorcised-a-cache-avalanche-with-async-reconnection-and-a-bloom-filter-4dfb</guid>
      <description>&lt;p&gt;*At 3 AM, the P99 latency on the monitoring screen spiked from 50ms to 3.8 seconds, then automatically dropped back down after two minutes. No errors, no garbage collection, and the Redis panel appeared normal. It was like a ghost, punctually strangling our order system every six hours.&lt;/p&gt;

&lt;p&gt;This was my most unforgettable debugging experience—not because it was particularly complex, but because all conventional methods failed, and the truth ultimately lay in the "tacit understanding" between TCP Keepalive and the cloud SLB.&lt;br&gt;
Problem Description (with images preferred)&lt;br&gt;
• Service: Core e-commerce order system, peak QPS 20,000&lt;br&gt;
• Symptoms: Severe fluctuations every 360 minutes (precise as a clock)&lt;br&gt;
• P99 latency: 50ms → 3800ms (76 times)&lt;br&gt;
• Timeout rate: 0.1% → 5%, approximately 2000 orders lost each time&lt;br&gt;
• Duration: Automatically recovers after approximately 2 minutes&lt;/p&gt;
&lt;h2&gt;
  
  
  The team initially suspected a "scheduled task" or "JVM Full GC," but these were ruled out after investigation.
&lt;/h2&gt;

&lt;p&gt;Detective Work (How I found the "ghost")&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stack Extraction
Before the next fluctuation, I continuously dumped 50 thread snapshots using jstack. The comparison revealed:
60% of worker threads were blocked at RedisConnectionFactory.getConnection(), and all were waiting for the same lock.&lt;/li&gt;
&lt;li&gt;Elimination Method&lt;/li&gt;
&lt;li&gt;Redis Monitoring: CPU, memory, and connection counts are all normal.&lt;/li&gt;
&lt;li&gt;GC Logs: No Full GC.&lt;/li&gt;
&lt;li&gt;Network: No packet loss.&lt;/li&gt;
&lt;li&gt;The Truth Revealed
Redis was not configured with an idle timeout, but the cloud provider's SLB forcibly disconnected idle connections every 360 minutes.
When the connection was actively closed by the server, thousands of concurrent requests simultaneously discovered the connection failure and flooded into &lt;code&gt;getConnection()&lt;/code&gt; to compete for the lock and synchronously reconnect.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  This is the "thundering herd effect"—all threads queue to rebuild connections, the database is compromised, and recovery only occurs when a new connection pool is established.
&lt;/h2&gt;

&lt;p&gt;Remedial Solutions (Three Prescriptions)&lt;br&gt;
Prescription 1: Asynchronous Reconnection + Local Degradation (Stopping the Bleeding)&lt;br&gt;
· Only the first request triggers asynchronous reconstruction (CompletableFuture.supplyAsync)&lt;br&gt;
· Other requests immediately return to the Caffeine local cache (allowing 5 seconds of old data)&lt;br&gt;
· Retry uses exponential backoff + random jitter to avoid reconnection storms&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="c1"&gt;// Core logic pseudocode&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isBroken&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;atomicFlag&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;compareAndSet&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

&lt;span class="nc"&gt;CompletableFuture&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;runAsync&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;reconnect&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fallbackCache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Non-blocking!&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: 99.99% reconnection success rate, eliminating regular jitter for the first time.&lt;/p&gt;




&lt;p&gt;Prescription Two: Bloom Filter + Proactive Refresh (Root Cause Solution)&lt;/p&gt;

&lt;p&gt;· Bloom filter (96MB memory supports 100 million keys) blocks 90% of non-existent key penetration attacks.&lt;/p&gt;

&lt;p&gt;· Set cache TTL to 10 minutes, with a background scheduled task asynchronously refreshing 2 minutes in advance to ensure keys never expire simultaneously.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result: Redis hit rate increased from 85% to 99.2%, database QPS decreased by 94%.
&lt;/h2&gt;

&lt;p&gt;Prescription Three: Timeout Circuit Breaker + Fallback (Ultimate Insurance)&lt;br&gt;
· Set Redis operation timeout to 15ms + Hystrix circuit breaker.&lt;br&gt;
· Automatically switch to local cache after timeout and record degradation metrics.&lt;br&gt;
Result: Even if Redis completely crashes, the order creation process remains available.&lt;/p&gt;




&lt;p&gt;Results Comparison (Data Speaks)&lt;br&gt;
&lt;strong&gt;Indicators&lt;/strong&gt; Before Optimization After Optimization Improvement&lt;br&gt;
P99 Latency (Steady State) 50ms 32ms ↓36%&lt;br&gt;
**Jitter Peak 3800ms No Jitter Eliminated&lt;br&gt;
Cache Hit Rate 85% 99.2% ↑14.2%&lt;br&gt;
CPU Average Load 75% 45% ↓40%&lt;br&gt;
Timeout Rate 0.1% 0% Completely Zeroed&lt;/p&gt;

&lt;h2&gt;
  
  
  The monitoring curve changed from jagged peaks to a straight green line.
&lt;/h2&gt;

&lt;p&gt;Lessons Learned (For Followers)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No anomalies in monitoring ≠ System health—You must delve into the thread stack and infrastructure layer.&lt;/li&gt;
&lt;li&gt;Connection pools are not a panacea—the "silent disconnection" of external dependencies is the most insidious killer.&lt;/li&gt;
&lt;li&gt;Cache invalidation should be "proactive" rather than "passive"—use preloading instead of expired eviction.&lt;/li&gt;
&lt;li&gt;Always have fallback—even old data is better than timeout.  After this fix, I deleted the "emergency restart script" prepared by the operations team—because it was no longer needed.
That 6-hour ghost has finally been completely sealed away.
---
AcknowledgementsThis is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-07-09"&gt;Weekend Challenge: Passion Edition&lt;/a&gt;*
## What I Built
&amp;lt;!-- Tell us about your project! What does it do and what was your intended goal? --&amp;gt;
## Demo
&amp;lt;!-- Embed your project (i.e. Cloud Run) or share a deployed link/video demo of your project --&amp;gt;
## Code
&amp;lt;!-- Show us the code! You can embed a GitHub repo directly into your post. --&amp;gt;
## How I Built It
&amp;lt;!-- Walk us through your technical approach and any interesting decisions you made along the way. If you used any of the prize category technologies, be sure to highlight how you incorporated them here! --&amp;gt;
## Prize Categories
&amp;lt;!-- Are you submitting to any prize categories? Note which ones apply (Best Use of Snowflake, Best Use of Solana, Best Use of ElevenLabs, Best Use of Google AI). If not, you can remove this section. --&amp;gt;
&amp;lt;!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. --&amp;gt;
&amp;lt;!-- Thanks for participating! --&amp;gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>bugsmash</category>
      <category>performance</category>
    </item>
    <item>
      <title>That's what the Finish-Up-A-Thon is all about.</title>
      <dc:creator>Bigboss6797976</dc:creator>
      <pubDate>Sun, 07 Jun 2026 23:49:59 +0000</pubDate>
      <link>https://dev.to/bigboss6797976/thats-what-the-finish-up-a-thon-is-all-about-3b2n</link>
      <guid>https://dev.to/bigboss6797976/thats-what-the-finish-up-a-thon-is-all-about-3b2n</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;This is a submission for the GitHub Finish-Up-A-Thon Challenge &lt;br&gt;
What I Built PayFusion AI is a full-stack intelligent payment aggregation system that supports multi-channel payment with one QR code using platforms like Alipay, WeChat, USDT, and PayPal. It integrates automatic transfers, fund distribution, QR code parsing, and AI-driven real-time payment monitoring. This project started out as a simple Flask QR code generator but gradually evolved into a complete payment automation platform. Key features include: Multi-channel payment with one QR code: Dynamically generates aggregated QR codes and intelligently routes users to the corresponding payment channels based on their scanning environment. AI fund monitoring Agent: Monitors payment status in real-time, automatically confirms fund arrival, and triggers subsequent workflows. Dual-platform architecture: Flask Web management backend + Telegram Bot mobile control. Automatic transfer engine: Supports automatic collection and fund distribution of USDT on the TRON network. Offline signature and blind signature: Complete blockchain security testing module. The entire project was developed and deployed entirely in a Termux Android terminal, eventually pushed to GitHub and automated using Railway/Render.&lt;br&gt;
Demo GitHub repository: Bigboss6797976/ailipay &lt;br&gt;
Telegram Bot: @PayFusionBot (demo environment) Web panel: &lt;a href="https://ailipay-production.up.railway.app" rel="noopener noreferrer"&gt;https://ailipay-production.up.railway.app&lt;/a&gt; (demo environment) Screenshot preview: Web-side aggregated QR code generation interface Telegram Bot real-time payment notifications Fund diversion rule configuration panel Development environment in Termux&lt;br&gt;
Turning point: Systematically "cleaning up the mess" I decided not to rewrite but to fix it—this is what Finish-Up-A-Thon is all about. First step: Environmental cleanup&lt;/p&gt;

&lt;h1&gt;
  
  
  Thoroughly clean up the corrupted lock files on Hardhat
&lt;/h1&gt;

&lt;p&gt;rm -rf node_modules package-lock.json npm cache clean --force npm install&lt;br&gt;
Step 2: Termux Compatibility Modifications   Install Termux-specific compilation dependencies for Pillow: pkg install libjpeg-turbo libpng    Replace psutil with native Python os and subprocess to rewrite the system monitoring module   Downgrade TronWeb to v4 stable and refactor all address generation logic   Install the zbar system library: pkg install zbar and set LD_LIBRARY_PATH  &lt;/p&gt;

&lt;p&gt;Step 3: Deploy Pipeline Fixes   Fix Flask's RGBA color parsing errors by switching to hexadecimal color values   Generate a one-click deployment script, railway_fix.sh, to automate CI/CD from Termux → GitHub → Railway   Create a streamlined requirements file for Render, removing dependencies with compilation conflicts  &lt;/p&gt;

&lt;p&gt;Step 4: Architecture Upgrade   Split the messy scripts into modular structures: bot.py (TG side), app.py (Web side), payment/ (core), crypto/ (on-chain)   Introduce the aiogram 3.7+ asynchronous framework and rewrite all Telegram interaction logic   Add environment variable management to completely decouple sensitive information from the code  &lt;/p&gt;

&lt;p&gt;Current Status  Today, this project has become a production-ready system:   ✅ Passed all unit tests with zero errors   ✅ Stably running on Railway and Render   ✅ Telegram Bot supports over 20 commands and 80+ feature modules   ✅ Complete payment flow: scan code → payment → confirmation → automatic transfer → notification   ✅ Codebase has evolved from "unrunnable" to "maintainable and scalable"  &lt;/p&gt;

&lt;p&gt;The Biggest Takeaway  What this project taught me wasn’t just a specific technology stack, but how to deliver engineering solutions in resource-limited environments. When the development environment is just an Android phone, when the compiler throws its 50th error, when the documentation says "not supported on this platform"—choosing to keep debugging instead of giving up—that’s what "Finishing-Up" really means.&lt;/p&gt;

&lt;p&gt;To you guys who are also developing on phones/tablets, if you're struggling with Termux, remember these tips: 1. Use $HOME as your build directory and copy it to shared storage to avoid permission issues. 2. If you run into compilation errors, check the system libraries first - pkg install usually works before pip install. 3. Lock down dependency versions since Termux isn't standard Linux, and the latest versions often mean incompatibility. 4. Write a one-click script to combine "push → deploy → check" into one command to reduce mental stress. Thanks to GitHub and DEV for organizing this challenge. Completing one project is more valuable than starting ten. If you're also cleaning up messes, keep going - the release date is just around the corner. If you're interested in this project, feel free to Star it or submit an Issue on GitHub!&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>ai</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
