Tech News
← Back to articles

Zram Performance Analysis

read original related products more articles

Zram Performance Analysis

Introduction

Zram is a kernel module that utilizes a compressed virtual memory block device allowing for efficient memory management. In this document we will analyze the performance of various compression algorithms used in Zram and their impact on the system. We will also discuss the effects of different page-cluster values on the system’s latencies and throughput.

Compression Algorithm Comparison

The following table compares the performance of different compression algorithms used in Zram, in terms of compression time, data size, compressed size, total size, and compression ratio.

Data from Linux Reviews :

Algorithm Cp time Data Compressed Total Ratio lzo 4.571s 1.1G 387.8M 409.8M 2.689 lzo-rle 4.471s 1.1G 388M 410M 2.682 lz4 4.467s 1.1G 403.4M 426.4M 2.582 lz4hc 14.584s 1.1G 362.8M 383.2M 2.872 842 22.574s 1.1G 538.6M 570.5M 1.929 zstd 7.897s 1.1G 285.3M 298.8M 3.961

Data from u/VenditatioDelendaEst:

algo page-cluster MiB/s IOPS Mean Latency (ns) 99% Latency (ns) comp_ratio lzo 0 5821 1490274 2428 7456 2.77 lzo 1 6668 853514 4436 11968 2.77 lzo 2 7193 460352 8438 21120 2.77 lzo 3 7496 239875 16426 39168 2.77 lzo-rle 0 6264 1603776 2235 6304 2.74 lzo-rle 1 7270 930642 4045 10560 2.74 lzo-rle 2 7832 501248 7710 19584 2.74 lzo-rle 3 8248 263963 14897 37120 2.74 lz4 0 7943 2033515 1708 3600 2.63 lz4 1 9628 1232494 2990 6304 2.63 lz4 2 10756 688430 5560 11456 2.63 lz4 3 11434 365893 10674 21376 2.63 zstd 0 2612 668715 5714 13120 3.37 zstd 1 2816 360533 10847 24960 3.37 zstd 2 2931 187608 21073 48896 3.37 zstd 3 3005 96181 41343 95744 3.37

Data from my raspberry pi 4, 2gb model:

... continue reading