<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>故障 on withdong02</title>
    <link>https://withdong02.top/tags/%E6%95%85%E9%9A%9C/</link>
    <description>Recent content in 故障 on withdong02</description>
    <image>
      <title>withdong02</title>
      <url>https://withdong02.top/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url>
      <link>https://withdong02.top/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link>
    </image>
    <generator>Hugo</generator>
    <language>zh</language>
    <lastBuildDate>Sat, 25 Apr 2026 20:20:55 +0000</lastBuildDate>
    <atom:link href="https://withdong02.top/tags/%E6%95%85%E9%9A%9C/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>云服务器 OOM</title>
      <link>https://withdong02.top/posts/%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8-oom/</link>
      <pubDate>Sat, 25 Apr 2026 20:20:55 +0000</pubDate>
      <guid>https://withdong02.top/posts/%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8-oom/</guid>
      <description>&lt;p&gt;前一阵子，原来的云服务器快到期了，续费还不如买个新的，正好用来部署博客，想着负载不大，就选了实惠的规格，2核2G。&lt;/p&gt;
&lt;p&gt;最近想要部署一个项目，后端是 docker 化的，在我换好镜像源，执行 &lt;code&gt;docker-compose up -d&lt;/code&gt; ，一分钟后，我的 ide 和服务器断开了远程连接。重新连接依然不行。当我打开云厂商的监控页面时，看到恐怖的一幕，我的服务器好像要不行了。&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;PixPin_2026-04-19_18-09-08.png&#34; loading=&#34;lazy&#34; src=&#34;https://dongimagehost-1356670526.cos.ap-nanjing.myqcloud.com/2025/07/PixPin_2026-04-19_18-09-08.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;然后我尝试多个工具进行远程登录，无一例外都失败了。
我尝试通过网页 VNC 登录，看到了 &lt;code&gt;Out of memory: KIlled process&lt;/code&gt;，说明一点内存也没了。怪我选规格时没考虑那么多。后来 AI 分析：甚至连 SSH 守护进程都因为内存不够而被操作系统 OOM Killer 无情杀掉，远程连接彻底没戏。&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;PixPin_2026-04-19_18-33-53.png&#34; loading=&#34;lazy&#34; src=&#34;https://dongimagehost-1356670526.cos.ap-nanjing.myqcloud.com/2025/07/PixPin_2026-04-19_18-33-53.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;我的第一想法是重启，但依旧没用。问题出在我的 docker 上，所有容器都配置了 &lt;code&gt;restart: always&lt;/code&gt;，所以一开机容器自启动。经过简单算账后，我选择用钱来解决🧐。升级到了4G 内存。&lt;/p&gt;
&lt;p&gt;其实光升级内存还是有点紧张的，同时我还修改了 docker 的配置文件，限制了每个容器的可用内存。&lt;/p&gt;
&lt;p&gt;部署项目就简单了，先启动 docker 容器，然后启动后端 jar 包，前端用 pnpm 命令构建一下，再配置一下 nginx 反向代理，绑定域名就ok了。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
