Repository navigation
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.5, with libperfd 0.7.6 and php-perfcached 0.1.1. Coming from 0.7.4.4, read "Before you upgrade" first, and "Known issues" at the end: a fix release, 0.7.5.1, is coming next. The ChangeLog has the detail.
Before you upgrade
- From 0.7.4.x the fleet moves together. 0.7.5 speaks cluster wire epoch 4 alone and refuses a 0.7.4 node by name. Stop every node (
perfcli -E <enable> fleetstop), install 0.7.5 everywhere and start them all - no roll. The state is kept; the WAL and the snapshot did not change. - Move key-routing clients with the fleet. libperfd 0.7.6 routes by key against 0.7.5 alone, and an older libperfd not against 0.7.5: a
route_keyshandle on the other side sends every request through the forward hop, which refuses values over 58,000 bytes. - Take dumps again. perfload refuses a dump from an earlier perfdump (the format is version 2).
- Rebuild some libperfd programs. A program built against libperfd 0.7.5 that sets
perfd_opts.nameorworker_balanceafterperfd_opts_init(): until it is rebuilt, libperfd 0.7.6 reads them as unset. - apt upgrade no longer restarts the daemon. It leaves perfcached running until you restart it.
New
- TLS on the RESP and HTTP doors (
resp = <addr:port> tls,http = <addr:port> tls,[listen] tls_cert,tls_key,tls_min; a reload reads the pair again), watched by/stats tls, the page's tls card and thetls.certalert.auth_needs_tls = yesrefuses AUTH and the HTTP token in the clear off loopback.rediss://upstreams, with an optional client certificate. OpenSSL is linked when pkg-config finds it;perfcached -Vsays whether. - Upstream discovery: a listed master's replicas become upstreams (
upstream_discover = auto, the default), except behind a proxy or for a write-through collection. A Redis Sentinel as the upstream is followed, never read. - A Redis Cluster as the upstream, from one node: reads to the slot's shard, MOVED and ASK followed, writes through to the slot's master.
- Fleets form in order: the master admits joiners one at a time, and an admitted node serves no client data until every link between it and each member has answered both ways.
/stats collections[].keepsandcopies, NIC receive-queue and interrupt warnings at start, and[memory] pin = no.
Data kept safe
- A resize whose copy of a record found no room in the arena dropped that record (0.7.3 and 0.7.4.4 too); it now waits for room.
- Eager: two writes of one key through two nodes at one version could leave replicas disagreeing for good; every replica now keeps the same one.
- A node that bootstrapped after a whole-fleet restart from a peer still replaying its log could stay short; a bootstrap now waits for it.
- A mastership term a node followed but could not write is no longer claimed again at its next promotion; until the term is on disk the node takes no mastership and raises
cluster.term_unpersisted.
Reads that reach the key
- In shard and spread, a read-only read-through collection answered nil for keys another member owns, hash reads and JSON GET could answer empty, and EXISTS, TYPE, TTL and PTTL answered as if the key were absent. All now reach the key at its owner or a holder.
Security
- A cluster frame reaches the replay window only from the host its header names, under a budget of 4,096 streams; the relay port's TCP receiver grows its buffer with what arrives, not with the length announced.
- A RESP or HTTP door off loopback with no password or token is warned about at
-Cand at start. - php-perfcached: the Symfony adapter's
clear()escapes glob characters in its namespace, which could clear another namespace's keys.
Known issues - fixed in 0.7.5.1, coming next
- Write-through values over one record. Under
upstream_writes = through, a value too large for one record (about 256 KB with its key) is still sent to Redis, which takes it, and the client gets OK, but the fleet cannot hold it: an older copy of that key may keep answering until tracking invalidates it (for good withupstream_tracking = off), and after that reads fail as too large. Keep write-through values under 256 KB until 0.7.5.1. - A rejoining node can report ready early. A node rejoining while a reconcile pass is open can report ready before its copy of the fleet's state has finished, and for that moment answer a read with a key deleted while it was away, or an older value.
- Collection changes from the fleet write to disk on the cluster thread. A resize, autoscale or mode change that arrives from the fleet writes the collections file on the thread that also carries forwards and pulls; on slow storage that stalls them for as long as the fsync takes, and a read routed through such a node can answer as a miss.
0.7.5.1 also carries the fixes from a full code review of 0.7.5 - memory-safety fixes, refusals for malformed input, and corrections in the cluster, the upstream bridge, the client libraries and the tools - and its own page will list them.