Skip to content

Instantly share code, notes, and snippets.

@phizev
phizev / zswap-stats
Last active January 27, 2024 11:46
Simple, cruddy script to print out some zswap information, and attempt to calculate compression ratio, though unsure if it is accurate, nor if it accounts for overhead. Add -v to get raw dump of the module parameters and kernel debug statistics.
#! /bin/sh -
ENABLED=$(cat /sys/module/zswap/parameters/enabled)
COMPRESSOR=$(cat /sys/module/zswap/parameters/compressor)
ZPOOL=$(cat /sys/module/zswap/parameters/zpool)
PAGE_SIZE=$(getconf PAGE_SIZE)
STORED_PAGES=$(cat /sys/kernel/debug/zswap/stored_pages)
POOL_TOTAL_SIZE=$(cat /sys/kernel/debug/zswap/pool_total_size)
POOL_SIZE=$(numfmt --to=iec-i $POOL_TOTAL_SIZE)
@phizev
phizev / README.txt
Last active April 7, 2022 17:35
In short: Performance improvement, and a 50% reduction in cache_form, no negatives. Drupal database cache implementation using igbinary_(un)serialize().
Rationale:
igbinary does an excellent job at creating compact serialized data as opposed to
PHP's serializer. It's already used for serializing data stored in memcached,
Drupal's form cache can get notoriously large, can igbinary help?
https://github.com/igbinary/igbinary
Experimentation:
Drupal database cache implementation using igbinary_(un)serialize(). In my initial