\u521b\u5efa zram \u4ea4\u6362\u7a7a\u95f4<\/strong><\/div>\nzram \u672c\u8eab\u5df2\u7ecf\u5b58\u5728\u4e86\u5927\u7ea6 20 \u5e74\uff0c\u4f46\u53ea\u662f\u5728\u8fc7\u53bb\u7684\u4e00\u4e24\u5e74\u91cc\u624d\u5728\u4e00\u4e9b\u53d1\u884c\u7248\u4e0a\u4f5c\u4e3a\u4ea4\u6362\u7a7a\u95f4\u4f7f\u7528\u3002\u4f60\u7684\u4e00\u4e9b\u6216\u6240\u6709\u4e3b\u673a\u4e0a\u5f53\u524d\u7684 Linux \u73af\u5883\u53ef\u80fd\u6ca1\u6709\u7528 zram \u521b\u5efa\u4ea4\u6362\u7a7a\u95f4\u3002\u5982\u679c\u662f\u8fd9\u79cd\u60c5\u51b5\uff0c\u5b83\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u88ab\u8865\u6551\u3002<\/p>\n
\u5bf9\u4e8e Fedora 32\uff0c\u5b83\u662f\u9ed8\u8ba4\u4f7f\u7528 zram \u4ea4\u6362\u7a7a\u95f4\u4e4b\u524d\u7684\u6700\u540e\u4e00\u4e2a\u7248\u672c\uff0c\u5b83\u53ea\u9700\u8981\u4e09\u4e2a\u7b80\u5355\u7684\u547d\u4ee4\u3002<\/p>\n
\u9996\u5148\uff0c\u9a8c\u8bc1\u662f\u5426\u5b58\u5728 \u200b\u200bzram-swap.service\u200b\u200b \u6587\u4ef6\uff0c\u5b83\u4f5c\u4e3a \u200b\u200bzram\u200b\u200b RPM \u5305\u7684\u4e00\u90e8\u5206\u5b89\u88c5\uff1a<\/p>\n
# systemctl status zram-swap\u25cf zram-swap.service - Enable compressed swap in memory using zram Loaded: loaded (\/usr\/lib\/systemd\/system\/zram-swap.service; disabled; vendor preset: disabled) Active: inactive (dead)\r\n<\/pre>\n\u63a5\u4e0b\u6765\uff0c\u5b89\u88c5 \u200b\u200bzram-generator-defaults\u200b\u200b \u548c \u200b\u200bzram-generator\u200b\u200b \u8f6f\u4ef6\u5305\uff1a<\/p>\n
# dnf install zram-generator-defaults zram-generator\r\n<\/pre>\n\u542f\u7528\u5e76\u542f\u52a8 \u200b\u200bzram-swap\u200b\u200b \u670d\u52a1\uff1a<\/p>\n
# systemctl enable zram-swap.service# systemctl start zram-swap.service\r\n<\/pre>\n\u7136\u540e\u9a8c\u8bc1 \u200b\u200bzram0\u200b\u200b \u662f\u5426\u5b58\u5728\u5e76\u88ab\u7528\u4f5c\u4ea4\u6362\u7a7a\u95f4\uff1a<\/p>\n
# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:00 120G 0 disk\u251c\u2500sda1 8:10 2G 0 part \/boot\u2514\u2500sda2 8:20 118G 0 part \u251c\u2500vg01-root 253:00 10G 0 lvm \/ \u251c\u2500vg01-swap 253:10 3G 0 lvm [SWAP] \u251c\u2500vg01-usr 253:20 35G 0 lvm \/usr \u251c\u2500vg01-tmp 253:30 15G 0 lvm \/tmp \u251c\u2500vg01-var 253:40 35G 0 lvm \/var \u2514\u2500vg01-home 253:50 20G 0 lvm \/homesr0 11:01 1024M 0 romzram0 252:00 7.5G 0 disk [SWAP]\r\n<\/pre>\n\u7528 zram \u6539\u8fdb\u4ea4\u6362\u7a7a\u95f4<\/strong><\/div>\n\u8fd9\u5c31\u662f\u5168\u90e8\u5185\u5bb9\u4e86\u3002\u5728 Fedora \u4e0a\u8fd9\u5f88\u5bb9\u6613\u3002\u4e0d\u540c\u7684\u53d1\u884c\u7248\u53ef\u80fd\u4e5f\u4e00\u6837\u7b80\u5355\uff0c\u53ea\u662f\u8f6f\u4ef6\u5305\u540d\u79f0\u548c\u547d\u4ee4\u7684\u7ec6\u8282\u53ef\u80fd\u4e0d\u540c\u3002\u5728\u4f60\u7684\u7535\u8111\u4e0a\u8bd5\u8bd5 zram \u4ea4\u6362\u7a7a\u95f4\u5427\u3002\u5728\u6211\u7684\u4e0b\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5c06\u8fdb\u4e00\u6b65\u6f14\u793a\u4e00\u4e9b zram \u9009\u9879\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u6211\u5728\u6211\u7684\u7535\u8111\u4e0a\u82b1\u4e86\u5f88\u591a\u65f6\u95f4\uff08\u6211\u662f\u8bf4\u5de5\u4f5c\uff09\uff0c\u6211\u53d1\u73b0\u4e86\u5f88\u591a\u6709\u8da3\u7684\u4e1c\u897f\u3002\u5176\u4e2d\u6700\u8fd1\u5f15\u8d77\u6211\u6ce8\u610f\u7684\u662f \u200b\u200bzram0\u200b\u200b\u200b […]<\/p>\n","protected":false},"author":1469,"featured_media":262824,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-262822","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=262822"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262822\/revisions"}],"predecessor-version":[{"id":262826,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262822\/revisions\/262826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/262824"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=262822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=262822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=262822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}