
On Mon, 22 Apr 2013, "Trent W. Buck" <trentbuck@gmail.com> wrote:
I assume you'd have a non-negligible amount of zlib CPU churn when paging out to zram -- is that noticable? I suppose it is, but only when you have pegged BOTH CPU and RAM.
Using zram is a trade-off of CPU performance vs disk IO performance. As CPU performance has been increasing steadily at an exponential rate for the last 20 years and disk performance has been increasing at a slow linear rate over that period such a trade-off becomes increasingly beneficial. Pegging both CPU and RAM is something that's difficult to do given that running out of RAM results in processes being blocked on disk IO (regular file IO that's not in cache or swap). A quick test on an Intel T7500 CPU (which is far from the fastest CPU available today and wasn't even the fastest laptop CPU when I bought it) shows that gzip -9 on a 10MB file takes half a second of CPU time. While this is quite a bit of time (more than it would take to do a direct contiguous write of the same data) when you count random seeks for small access it's going to average a much higher rate than HDD access. Rates lower than 3MB/s are often seen on modern disks in real-world use due to seek overhead. Whether zram is better than SSD is another issue. With the Intel SSD I've tried the contiguous read and write speeds are quite a bit lower than that of hard disks and while the overall performance is a significant improvement over hard disks it's still not nearly as good as I'd hoped for. If SSD was as good as some people claim then zram might not offer much benefit. But with the 120G Intel SSDs I've tried there is plenty of scope for zram to boost performance. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/