大家有没有发现vscode ssh到云服务器的时候,有时候后台运行的进程占用很高,有几次登录aliyun的云服务器都把磁盘IO顶满导致连接中断,只能强制重启,最后只敢用aliyun自带的workbench登录了,有佬友碰到类似问题搞明白原因了吗?
+1, 我也只能重启解决
偶尔会出现,不明白为什么。不过用vsc来ssh登服务器是不是重了点,我一般用finalshell或者tabby之类
主要是调试代码的时候,vscode的插件方便边改边看结果
配置低的小鸡子,比如1C1G的那种,就别用VSCode的Remote ssh了。
可以试试看把家目录下的.vscode目录锁死,这样就不会有太大的io开销了
如果 VS Code 的 IO 都能把服务器 IO 打满,就需要考虑是不是服务器的 IO 能力实在是太低了。有条件的话,可以将 /home 单独挂载到独立的虚拟硬盘。如果没有条件,检查文件系统,是否全部都开了同步写,页面缓存是否没开,是否脏页允许比例过低之类的。
可能这个有用?(我没研究过)
【转 netcup】How to Use zRam for Compressing Data into RAM (小内存加了swap又能优先使用高速内存)
Introduction 介绍
Especially on systems with little RAM, it can happen from time to time that the available memory becomes scarce and the system starts to use swap memory. As swap memory is typically located on the hard drive, it is relatively slow compared to RAM and thus may impact the system’s performance.
尤其是在 RAM 较少的系统上,有时可能会出现可用内存不足的情况,系统开始使用交换内存。由于交换内存通常位于硬盘上,因此与 RAM 相比速度相对较慢,因此可能会影响系统性能。
A remedy is provided by a technology integrated in the Linux kernel called zRam. It creates a compressing block device directly in the computer’s RAM. The kernel first occupies the available RAM and then tries to compress parts of it into zRam. It effectively only moves data within the RAM, which is magnitudes faster than swapping to disk. This technique, therefore, allows more data to be accommodated in memory. Practically, this results in the system not having to swap to a slower hard disk as quickly. The price is a slightly increased processor load which usually has a much smaller impact than swapping to disk.
Linux 内核中集成的一项名为 zRam 的技术提供了一种补救措施。它直接在计算机的 RAM 中创建一个压缩块设备。内核首先占用可用的 RAM,然后尝试将其部分压缩到 zRam 中。它实际上只在 RAM 内移动数据,这比交换到磁盘要快几个数量级。因此,这项技术允许在内存中容纳更多数据。实际上,这导致系统不必快速交换到较慢的硬盘。代价是处理器负载略有增加,这通常比交换到磁盘的影响要小得多。
The installation is quite simple but can make a big impact on the performance of your server if memory is tight.
安装非常简单,但如果内存紧张,可能会对服务器的性能产生很大影响。
.....配置见链接
上述配置在内存较低的系统上效果很好。我们尽早开始交换(因为我们希望尽早使用 zRam),并设置了较高的缓存压力,以长期减少内存消耗。
看监控显示,只是磁盘IO满,内存占用都不高
此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。