Skip to content

perfcached 0.7.3

Choose a tag to compare

@Lt-Flash Lt-Flash released this 30 Oct 10:11
· 59 commits to master since this release

perfcached - found fast, kept safe

A multithreaded, self-clustering cache for Linux, with its own encrypted protocols and a Redis-compatible door. New here? Start with the README.

This page covers 0.7.0 to 0.7.3: 0.7.0, 0.7.1 and 0.7.2 were not published and have no pages of their own. Coming from 0.6.6, read all of it. The ChangeLog has the detail.

0.7.3 is the 0.7.3-rc19 build (a459dc6), green on both CI systems and rolled in one node at a time over 0.7.2-rc9 on a three-node test fleet on 2026-10-30. Unlike 0.6.6, it did not run the 72-hour soak before this tag was put on it: it was promoted on the maintainer's decision. Nothing was rebuilt for this page: the signed tarball below is the build running on that fleet.

A fleet upgrade from one command (0.7.0 - 0.7.3)

  • perfcli upgrade plan|start|resume|status|abort|rollback stages a build on every member, then switches one node at a time, members first and the master last, with a gate after each: a new pid on the version asked, ready with its peers up, the peers' records kept. The first failure reverts that node and stops with the rollback commands printed; a journal records the roll, and resume or rollback read it back.
  • perfcli fleet-status shows every member's version, state, install mode and staged builds in one table. perfcli upgrade-revert switches a node back to the prefix it kept before its last switch.
  • upgrade_stage refuses a package install ("upgrade it with the package manager"), and upgrade_status reports the install mode: package, prefix or local.
  • perfcli upgrade abort no longer connects to the node it is pointed at: an abort asked while that node was down failed with "cannot connect", and the roll ran on. (0.7.3)
  • README, GUIDE and PRODUCTION now tell one upgrade story, where they had contradicted each other: any patch of the same minor and the next minor roll; older releases step through each minor's last patch.

Deletes the fleet confirms (0.7.3)

  • Deletes are acknowledged. Every member says with its keepalive how far it holds each node's deletes, once its WAL has synced them, and a node forgets a delete as soon as every member holds it. A member that missed one asks for it again.
  • tombstone_retain_s and tombstone_retain_max now set how long and how much a missing member is waited for; while the fleet is whole, the table holds a beat or two of deletes. [cluster] tombstone_acks = no keeps the time rule, and so does a fleet with a member on an older build.
  • On a multicast fleet a delete goes to the group once instead of to each peer, while the fleet confirms and the delete fits max_datagram. An expiry in an eager collection leaves the table 10 s after it is reaped, unless a write had shortened the key's TTL.
  • /members shows how far behind each member is on each node's deletes. /stats cluster.acks.held_by names the member the kept deletes wait for, and the alert cluster.acks_stuck names a member that stops confirming while the others go on.
  • At the retained-delete table's cap the expired keys go first, so a short-TTL collection no longer makes the table forget real deletes. The table counts the two apart. (0.7.2)

A member back from an absence (0.7.1 - 0.7.3)

  • A member away longer than resync_after_s (a day by default), or back from a split that no peer was up long enough to witness, drops what it stored before and pulls the fleet's state, refusing clients until it holds it. Before, it kept keys the fleet had deleted meanwhile. Writes it accepted after the absence began are kept.
  • A restarted node dates its absence from what it last wrote again. Since 0.4.1 the directory lock written at startup made every restart look like an absence of a few seconds, so a peer up 30 s before the restart counted as a witness of the whole outage.
  • In an eager fleet, a member back from a silence without a restart, that may lack a delete nobody holds any more, is asked to rebuild: it reconciles every record it stored before the silence with the fleet, and keeps what it wrote since. A member restored from a snapshot older than deletes the fleet has forgotten reconciles in full.
  • After a restart a member asks its peers which of its records they hold, up to 256 keys a datagram, instead of pulling each one. (0.7.2)
  • cluster.peer_absent is raised only when the retained deletes did not cover the absence, and names the limit that did not. (0.7.1)

The cluster (0.7.2)

  • The native mget and RESP MGET look up every key this node does not hold, all at once under one deadline; before, a key on another node read as a miss. A key no node answered in time is reported as unanswered (RESP: -TRYAGAIN), never as absent.
  • A collection's autoscale mode is the fleet's: the autoscale verb reaches every member, also one that was away, and survives restarts.
  • In proxy mode, a key both sides of a partition wrote resolves to one value after the heal, also when the two writes carry the same version.
  • The cluster wire refuses what it used to obey or misread: an implausible term, a value length that wraps, a node id out of range, a sender that is not a member, and unicast datagrams meant for another daemon on the same host.

The WAL, cache collections and memory (0.7.2 - 0.7.3)

  • With fsync = always, a write that finds its WAL ring full waits for the log to drain instead of being dropped after the client was told it succeeded; on a fast NVMe disk a burst had still lost 9% of its writes to the log. A long sync now shows as write latency (wal.ring_waits, ring_wait_ms). everysec and no are unchanged. (0.7.3)
  • The WAL's room - its segments, the share in use, how fast it fills and how long the free space lasts against a snapshot - is on the page, in /stats and /metrics. The alert wal.capacity warns before the log fills.
  • A segment left open by kill -9 or a crash is closed at the next start. One lap of the ring later it used to be reported as an overrun, and the node went FAILED until it healed.
  • [collection x] durable = no keeps a cache collection off the WAL and out of the snapshot. After a restart the peers refill it; a whole-fleet restart leaves it empty.
  • A read no longer misses a key that the overflow drain or a table split moves at the same moment. A dropped table's index, or one a resize replaced, goes back to the room for records once nothing carved after it is in use; until then /stats shows it as arena_free_tables, not as used.

Read-through and write-through to Redis (0.7.1 - 0.7.3)

  • Through collections in shard read and write a key at its owner, in spread at its K holders.
  • A client reads its own write-through: within upstream_echo_ms of a node's own write, a fetch of the key goes to the master, not a replica that may not have the write yet. A read straight after a delete written through goes to the master too (0.7.3).
  • Many clients writing one key through at once leave the node holding what Redis holds. A fetch overtaken by an invalidation of its key is fetched again. After a tracking gap the copies held are fetched again in the background, newest written first.
  • A read-through copy goes no later than the key it copies; it could answer for up to a second after Redis expired the key. A copy fetched while its key kept changing no longer outlives upstream_negative_ms.
  • rename refuses a read-through collection: a live rename stopped reading and writing through without a word. Rename it in the config and restart every node at once. (0.7.2)

The dashboard is the page (0.7.0 - 0.7.1)

  • The daemon serves no page of its own: GET / answers 410 Gone and names perfcached-dashboard, and the HTTP door is read-only (POST /reset-stats answers 405; the reset is perfcli reset-stats or the dashboard's button). /stats, /members, /clients, /metrics and /health stay.
  • From the page you create, rename, resize and drop collections (the daemon's own verbs, announced to the fleet; the tool journals each), stage a signed build on a member, and run or stop the read-through drain sweep.
  • The fleet in one table: each member's version, install mode, staged builds and every collection's entry count. A node asked for is that node or an error naming it, never another member's figures or actions.
  • TLS in the tool itself (tls_cert, tls_key) where no proxy fronts it. An admin container image in contrib/docker/admin carries the dashboard, perfcli and nginx, with a compose.yml for two replicas behind one nginx.

Doors, config and tests (0.7.0 - 0.7.2)

  • systemctl reload or SIGHUP reads the config again and applies the allow-lists, the secrets, log_level and slowlog_usec; any other changed key refuses the reload whole, naming the keys. Before, SIGHUP stopped the daemon. (0.7.1)
  • The RESP door's DB-index map changes on a running fleet: perfcli map <index> <collection>, unmap <index> and maps, or from the page. Every member takes it, and it survives a restart. (0.7.1)
  • RESP replies keep their order behind a command that waits on the cluster, and pull_timeout_ms is honoured to within 25 ms. (0.7.2)
  • IPv6 client listeners, IPv6 entries in resp_allow and http_allow, and redis://[::1] upstreams. Without working IPv6 on the host, an IPv6 listener is refused with the reason. (0.7.2)
  • name <name>: a connection names itself, the native form of CLIENT SETNAME, shown by clients and in a node's enable, upfill, updrain and reset-stats log lines. Hot keys, always on: each node samples one request in 64 and names the keys that pin a thread.
  • Full Alpine packages from one APKBUILD in contrib/alpine, with OpenRC services and the accounts. The .apk files on this page are built from it.
  • CI adds fault-injection suites, a container fleet for partition tests, a seeded fuzzer for the hash table, and a tag job that rolls a three-member fleet with perfcli upgrade under a libperfd client's reads and writes, asserting no error, no lost key and no resurrection on every node. The fleet suites and the roll also run on the epoll backend.

libperfd 0.7.3

  • The operations verbs, typed: collections, create, drop, resize, rename, reset_stats, save, sync, load, mailtest, upgrade_status and fleetstop. Every request perfcli and the dashboard send has a typed form now.
  • perfd_upgrade_stage and perfd_upgrade_stage_file stage a release artifact in 192 KB chunks with its signature and a progress callback; perfd_upgrade_revert switches a node back. The handle sends opts.name after every dial.
  • The connect timeout is honoured (connect_timeout_ms, 5 s by default; standby connections 1 s). Before, a member whose host dropped the connection attempt held a client's first call for about two minutes. (0.7.2)

Files

The signed tarball: perfcached-0.7.3.tar.gz with perfcached-0.7.3.tar.gz.sig - the build running on the test fleet, x86_64, built on Debian 13 (glibc 2.41) with libcurl mail; it runs on glibc 2.34 or later. It unpacks to one prefix directory (bin/, lib/, include/, share/) for /opt, and it is what upgrade_stage, the dashboard's staging and the perfcached-upgrade helper take. Check it with the binary you already run (0.6.5 or later):

perfcached -K perfcached-0.7.3.tar.gz        # GOOD, the release key 5646e8e4 (built in)

Debian 12 and 13, Ubuntu 20.04 and 24.04, amd64:

  • perfcached: the clustered daemon, every cluster mode.
  • perfcached-standalone: the single-node edition, built from the same tree without the cluster code. A [cluster] section in its config is refused rather than ignored.
  • perfcached-dashboard: the status page's own process, and since 0.7.0 the only one; unit installed disabled. Not for Ubuntu 20.04: its libmicrohttpd (0.9.66) predates the API (0.9.71) the dashboard is written for. Run the dashboard on another machine for a 20.04 fleet - it reaches the members over the native door.
  • libperfd0: the client library, libperfd.so.0.
  • libperfd-dev: its header, static archive, libperfd.so link and libperfd.pc.

The two daemon packages install the same files and replace each other. They do not need libperfd0: install it, or libperfd-dev, for your own programs. They no longer restart the daemon on upgrade: restart a clustered cache's members first and the master last, one at a time, as PRODUCTION.md section 8 says. The dashboard package keeps the automatic restart.

sudo apt install ./perfcached_0.7.3-1+deb13_amd64.deb
sudo apt install ./perfcached-dashboard_0.7.3-1+deb13_amd64.deb    # on the machine that shows the page
sudo apt install ./libperfd0_0.7.3-1+deb13_amd64.deb ./libperfd-dev_0.7.3-1+deb13_amd64.deb   # to build against libperfd

Each distribution's packages were built for it: Debian 13 natively (gcc 14.2, glibc 2.41), Debian 12 (gcc 12.2), Ubuntu 24.04 (gcc 13.3) and Ubuntu 20.04 (gcc 9.4, debhelper from focal-backports) each in a container of that distribution. Ubuntu 24.04's are built without LTO, which Ubuntu turns on by default: gcc 13's LTO pass raises a false "may be used uninitialized" in this tree, and the build treats warnings as errors. The other three are built without LTO by their distributions' defaults. Every build ran noisetest, the selftest and a deliberately broken-lock build that must fail. Each set was then checked in a clean container of its distribution:

  • the version and revision perfcached -V reports (0.7.3 (a459dc6e5)), and the systemd unit;
  • the daemon starting and answering ping, set and get over its encrypted native door from perfcli (on epoll: the containers' default seccomp profile refuses io_uring);
  • a program built against libperfd-dev through pkg-config, linking libperfd.so.0 and reporting 0.7.3;
  • the shipped config passing perfcached -C, a [cluster] section refused by the standalone edition, and the two editions replacing each other;
  • the dashboard package: its binary's libraries, its unit file and the example config;
  • an upgrade over the published 0.6.6 packages.

Alpine 3.24 (musl), x86_64, both editions, as tarballs of the tree's make install layout: binaries in usr/bin (the dashboard among them), libperfd (shared and static) with perfd.h and libperfd.pc, the example config, and the docs. No systemd unit or OpenRC service is in these tarballs; run the daemon under your own supervisor, or use the packages below, which carry the OpenRC services.

apk add libsodium libcurl libmicrohttpd
tar -xzf perfcached-0.7.3-alpine3.24-x86_64.tar.gz
cp -a perfcached-0.7.3-alpine3.24-x86_64/usr perfcached-0.7.3-alpine3.24-x86_64/etc /

Built with gcc 15.2 on Alpine 3.24.3 in a clean container behind the same three gates, then checked in a second clean container: -V and the musl interpreter, the dashboard's libraries, the round trip, the libperfd program, the shipped config and the [cluster] refusal.

Alpine 3.24 packages: every package contrib/alpine/APKBUILD builds, as .apk, signed with the perfcached release key: perfcached (with its OpenRC service and account), perfcached-standalone, perfcached-dashboard (its own service and account), perfcached-doc, libperfd and libperfd-dev. Trust the key once (its public half is attached here and in contrib/alpine/keys), then install:

cp yury@kfi.net.au-6aca2bb6.rsa.pub /etc/apk/keys/
apk add ./perfcached-0.7.3-r0.apk                                   # or ./perfcached-standalone-0.7.3-r0.apk
apk add ./libperfd-0.7.3-r0.apk ./perfcached-dashboard-0.7.3-r0.apk  # on the machine that shows the page
apk add ./libperfd-0.7.3-r0.apk ./libperfd-dev-0.7.3-r0.apk          # to build against libperfd

Built with gcc 15.2 on Alpine 3.24.3, then checked in a clean container that trusts only that key: everything installs; perfcached -V reports 0.7.3 (a459dc6e5); the OpenRC services and the accounts are in place; the shipped config passes perfcached -C; the dashboard's libraries resolve; pkg-config reports 0.7.3, and a program links the shared or the static library and pings the installed daemon; the standalone package replaces the clustered one; and without the key apk refuses them as untrusted.

SHA256SUMS covers every file on this page.

Known

  • During an automatic shrink or a resize, a key written while the copy runs can read as absent until the drain after the swap reaches it - up to about 20 seconds at a million records. Deletes are not affected. To be fixed in 0.7.4.
  • With [cluster] tombstone_acks = no, or while a member runs a build older than 0.7.3, deletes are kept by time as in 0.6.6: in eager mode a delete made on one side of a partition that outlasts tombstone_retain_s can be undone when the partition heals.
  • In a container under Docker's or podman's default seccomp profile, io_uring is refused and the daemon runs on epoll. perfcached -C and the log say which.
  • No lists, sets, sorted sets or streams yet. Keys hold strings, counters, JSON documents or hashes.
  • discovery = unicast (clouds, Kubernetes) is tested in lab network namespaces, not yet in a real cloud deployment. spread mode has not yet carried production traffic.
  • The RESP and HTTP doors are plaintext: keep them on a trusted segment, behind their allow-lists.