Files
oneclickvirt.github.io/assets/case_case6.md.fe0df4f5.lean.js
2023-10-24 00:43:47 +00:00

2 lines
2.7 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as a,v as s,b as e,R as r}from"./chunks/framework.70afa331.js";const y=JSON.parse('{"title":"仓库","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"case/case6.md","filePath":"case/case6.md","lastUpdated":1698108197000}'),t={name:"case/case6.md"},p=r('<h1 id="仓库" tabindex="-1">仓库 <a class="header-anchor" href="#仓库" aria-label="Permalink to &quot;仓库&quot;"></a></h1><p><a href="https://github.com/spiritLHLS/addzram" target="_blank" rel="noreferrer">https://github.com/spiritLHLS/addzram</a></p><h1 id="addzram" tabindex="-1">addzram <a class="header-anchor" href="#addzram" aria-label="Permalink to &quot;addzram&quot;"></a></h1><p>为linux服务器启用zram(压缩内存)</p><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-L</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">https://raw.githubusercontent.com/spiritLHLS/addzram/main/addzram.sh</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-o</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">addzram.sh</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&amp;&amp;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">chmod</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">+x</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">addzram.sh</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&amp;&amp;</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">bash</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">addzram.sh</span></span></code></pre></div><p>类同前面的addswap项目</p><p>同样是给机器优化内存占用的东西只不过zram是压缩内存占用swap是附加虚拟内存增加内存空间二者都会占用CPU资源zram在CPU性能冗余的机器上使用更优</p><p>(理论上zram会比swap的性能占用低但未实际测试过)</p><p><strong>单位换算:输入 1024 产生 1G 的 zram 设备压缩内存zram 设备大小不能大于实际内存大小</strong></p><h1 id="致谢" tabindex="-1">致谢 <a class="header-anchor" href="#致谢" aria-label="Permalink to &quot;致谢&quot;"></a></h1><p>感谢 <a href="https://github.com/Ella-Alinda" target="_blank" rel="noreferrer">@Ella-Alinda</a> 提供优化建议</p>',11),n=[p];function o(l,c,d,i,h,m){return s(),e("div",null,n)}const A=a(t,[["render",o]]);export{y as __pageData,A as default};