
从一次线上 OOM 事故,拆解 RAG 流式响应的内存模型
一次 RAG 服务在高峰期出现 OOM 和首包延迟飙升,根因不在模型,而在流式响应的背压缺失与闭包泄漏。本文从 V8 堆内存与微任务队列出发,剖析 SSE 流式链路的内存放大效应,给出一套可落地的背压、切分与生命周期治理方案。

Frontend Developer · AI Enthusiast · Fullstack Engineer
Exploring the intersection of modern web technology and artificial intelligence. Building beautiful, performant applications.
I'm a passionate developer focused on building modern web applications that combine beautiful design with powerful technology.
With expertise in frontend frameworks like React, Vue, and Astro, I create performant, accessible, and visually stunning user experiences.
I'm particularly interested in the intersection of web development and artificial intelligence, exploring how AI can enhance the way we build and interact with software.

Private jet charter service platform, providing global luxury aviation solutions.

Jet-Bay iOS app, book private jets anytime, anywhere.

A collection of free public APIs including weather data, quotes, images, and geographic information.

This personal website built with Astro, React, and Tailwind CSS.

A modern blog platform with markdown support and SEO optimization.

An intelligent creation tool built with Next.js and AI SDK, featuring streaming output and RAG.

一次 RAG 服务在高峰期出现 OOM 和首包延迟飙升,根因不在模型,而在流式响应的背压缺失与闭包泄漏。本文从 V8 堆内存与微任务队列出发,剖析 SSE 流式链路的内存放大效应,给出一套可落地的背压、切分与生命周期治理方案。

面对“页面用久了变卡甚至崩溃”的问题,仅会用 Chrome DevTools 拍快照是远远不够的。这是一个考察综合能力的问题,真正的高手需要从常见场景、浏览器原理、本地与线上排查,到构建完整的治理体系,形成一套闭环的解决方案。

在现代 Web 应用中,用户登录状态的管理是构建交互体验的基础。然而,在复杂的分布式架构中(如 Next.js + Supabase + 自定义 API Server),登录流程的时序问题往往成为开发者需要重点解决的痛点:**如何确保登录请求、Token 刷新、状态同步与接口调用在正确的时间节点完成,避免因时序错位导致的数据不一致或请求失败?** 本文将深入探讨登录态的时序设计,通过流程解析、代码示例及优化策略,帮助构建可靠的认证体系。
Try out my AI chatbot. Ask questions, get creative, or just have a conversation.
Start ChattingMessage sent! Thanks for reaching out, I'll get back to you soon.
Failed to send. Please try again later.
This website uses cookies to enhance your browsing experience. By continuing to browse, you agree to our cookie policy.
Learn moreThis website is for demonstration and learning purposes only
This is a personal showcase website used to demonstrate technical capabilities and project experience. All data is stored locally in your browser and is not uploaded to any server.
Secure Authentication
Login to submit messages, comments, and more
Don't have an account?
Register to sync your information
Already have an account?