Skip to content

perfcached 0.5.1

Choose a tag to compare

@Lt-Flash Lt-Flash released this 06 Oct 10:59
· 1 commit 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.

A rolling restart. 0.5.1 joins a 0.4.5, 0.4.6 or 0.5.0 fleet one node at a time: restart the members first and the master last, and read the fleet between nodes. The storage formats, the wire epoch and libperfd (0.4.0) are unchanged; an older node ignores the two new lane messages. Every node keeps the identity it has - see below for switching to one derived from the machine.

A node's identity comes from the machine

  • With a state directory and the default identity_source = auto, the identity is derived from the platform - the VM's DMI product uuid, or inside a container (where that uuid is the host's) a NIC's MAC - keyed by a salt the node mints once into its state directory (node-salt). A disk cloned onto another VM comes up as a new member rather than a twin; two daemons on one machine are two members; a state directory moved to another path keeps its identity.
  • An identity already on disk with no node-salt beside it - one an earlier release minted at random, or derived under a site_salt since removed - is kept, with a WARNING naming the source the machine offers. To switch, stop the node and delete node-identity (or set identity_source = dmi / mac); it then joins as a new member, so on a fleet holding data do it one node at a time.
  • product_uuid is readable only by root and the daemon runs as perfcached: the shipped clustered unit copies it into the service's runtime directory first (RuntimeDirectory=perfcached and a root ExecStartPre=-+ step). A unit written for an earlier release needs those two lines for the DMI source.

autoscale = floor

  • A fourth mode beside auto, warn and off: the collection grows by key count as auto does, and shrinks only down to the size it was given - its buckets_log2, a create's size, or an explicit resize. An empty collection sized for the keys it expects keeps that size instead of being shrunk a minute after the start. /stats carries autoscale_floor_log2 for every collection.

Cluster

  • A departing master's goodbye is no longer taken for a UDP block. Its members measured its silence from the machine's boot and, while its TCP lane still answered during its shutdown snapshot, moved all their traffic to it onto TCP - for good.
  • A forced lane now comes back: the node asks the peer by UDP every [cluster] lane_retry_s (default 30) and returns to UDP once the answer proves both directions (/stats cluster.lane.udp_restored). A peer that leaves takes its forced lane with it.

Store

  • A SCAN, a snapshot or a resize copy that walked a table's overflow leg while the leg drained back into the buckets could miss a record: the walk found its place again by position after records ahead of it had left. It now resumes after the last record it handed over that is still in the chain - a record may be handed over twice, never skipped.

Known

  • No sorted sets, lists or streams yet. Keys hold strings, counters, JSON documents or hashes (a hash is one value, under 58,000 bytes).
  • discovery = unicast (clouds, Kubernetes) is tested in lab network namespaces that drop IP fragments and block UDP, not yet in a real cloud deployment. spread mode has not yet carried production traffic.
  • In eager mode a delete made on one side of a network partition can be undone when the partition heals.

Packages

Debian 12 and 13, Ubuntu 20.04 and 24.04, amd64, in both editions:

  • 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.

The two install the same files under the same names and replace each other, so moving between editions is one apt install. Each package was built in a clean container and install-checked in a second one: the version and revision, the edition perfcached -V reports, the shipped config passing perfcached -C, the systemd unit (the clustered one with the runtime directory and the DMI copy step), and for the standalone package that a [cluster] section is refused and that installing perfcached over it swaps the edition.