zram 压缩流
Raspberry Pi and other single-board computers (SBCs) have always had minimal memory. At a maximum of 1GB in the Raspberry Pi 3, it was just sufficient to run lightweight programs and scripts. That trend held until the advent of the Raspberry Pi 4 with 2GB, 4GB and a few months later, 8GB models, opening doors to running databases and other memory intensive applications.
Raspberry Pi和其他单板计算机(SBC)始终具有最小的内存。 Raspberry Pi 3的最大容量为1GB,足以运行轻量级程序和脚本。 这种趋势一直持续到2GB , 4GB以及几个月后的8GB型号Raspberry Pi 4问世,为运行数据库和其他内存密集型应用程序打开了大门。
This shift is due in no small part to the explosive growth of the data industry, where previously the focus of SBCs was IoT and embedded applications and now the focus is slowly shifting towards data applications. Memory has also become cheaper over the years, allowing newer SBCs to have more memory while maintaining a similar price range.
这种转变在很大程度上是由于数据行业的爆炸性增长,以前SBC的重点是物联网和嵌入式应用程序,而现在的重点正在慢慢地转向数据应用程序。 多年来,内存也变得越来越便宜,从而使新型SBC可以拥有更多内存,同时保持相似的价格范围。
我的担忧 (My concerns)
With the Raspberry Pi 3 trending towards obsolescence, I got worried about how my 28-core Kraken cluster can stay relevant and useful for at least another year.
随着Raspberry Pi 3趋于过时的趋势,我担心我的28核Kraken集群如何在至少一年内保持相关性和有用性。
On the other hand, I’m secretly looking forward to deprecating the Kraken cluster as I’ve run into countless awkward situations where the system runs out of memory and all SSH sessions lock up while the kernel struggles for a good 10 minutes before panicking and forcing a reboot.
另一方面,我暗自希望弃用Kraken群集,因为我遇到了无数尴尬的情况,其中系统用尽了内存,所有SSH会话都被锁定,而内核在正常运行10分钟之前就出现了崩溃和崩溃。强制重启。
In fact, that happens to me about once a week! If you’ve run a good number of applications on the Raspberry Pi 3 before, I’m sure you share my pain.
实际上,这大约一周一次发生在我身上! 如果您以前在Raspberry Pi 3上运行过很多应用程序,那么我相信您会分担痛苦。
After a round of excavation in the depths of the Raspberry Pi forums, I found a glimmer of hope for the issues of impending obsolescence and restrictive memory capacity of the Raspberry Pi 3.
在Raspberry Pi论坛的深处进行了一轮挖掘之后,我发现了即将到来的Raspberry Pi 3过时和限制性内存容量问题的希望。
The solution is zram swap.
解决方案是zram swap 。
In this piece, I’ll demonstrate how you can use zram to increase the available memory by about 50% with negligible performance impact.
在本文中,我将演示如何使用zram将可用内存增加约50%,而对性能的影响却微不足道。
什么是zram? (What is zram?)
zram, formerly called compcache</