Scalability#
How the pull from OCI registries grows with the number of targets, and where shirudo and the kernel limit what one target and one upatch can hold. shirudo’s limits come from its code. Kernel limits come from the kernel source and can differ between kernel versions and architectures; each one names its constant so that you can look it up in your kernel. Overhead describes what one target uses.
Fleet#
shirudo keeps no fleet state and has no push channel. Every target runs its own timers and pulls from the registries its config image names, so the load on a registry grows with the number of targets that follow it.
Registry requests#
Command |
Requests per target |
|---|---|
|
Every minute, for every repository: the index manifest, the index and its signature, each downloaded in full. There is no conditional request, and the cached index is not consulted. |
|
Every minute with a tree configured: the tree’s manifest, payload and signature, in full. A target that is behind the segment the reference names also fetches each sealed segment back to the one its last applied operation lies in, twice: once on the walk back, once to apply it. A upatch the tree adds is fetched once, manifest and blob, and cached by its layer digest. |
|
Nothing until the cached index lists a newer version of an installed package. Then the package manifest and the whole package archive. |
A registry that challenges for a bearer token gets three requests for each of these: the request without credentials, the token request and the request again with the token. Tokens are not kept between requests or runs. Every request opens a new connection with its own TLS 1.3 handshake.
N targets that follow R repositories and a tree therefore send a registry about N × (3R + 3) requests per minute, three times that with token authentication, and download the indexes, the tree payload and their signatures N times a minute. An index holds at most 512 entries and has to parse within 8 MiB.
Timing and failures#
shirudo-bpm-repo-update.timerstarts the update at boot and 60 seconds after each run ends.shirudo-bpm-tree-sync.timerstarts the sync 60 seconds after boot and every 60 seconds after that. Neither timer sets a random delay, so targets spread over the minute only as far as their boot times and run times differ. Targets that boot together, after a power cut for example, poll together.A version pushed to an index reaches every target that follows the repository within about a minute, and every target that has the package installed downloads the whole archive, up to 256 MiB, in that minute. There is no delta and no resumed download.
A failed request is not retried. A failed run waits for the next run of its timer, and status 429 and
Retry-Afterget no special handling. One unreachable repository does not stop the update of the others, andbpm upgradestill runs from the cached indexes.A connection has 30 seconds to open, and a transfer that moves less than 1 byte per second for 60 seconds is cut. A request has no overall time limit; the service has 30 minutes.
Staged rollouts#
A repository is one registry endpoint,
oci://<host>[:<port>]without a path, and its index is at<namespace>/bpm-index:stableon it. There is no mirror or fallback list. To stage a package, publish it to a registry that only canary targets follow before the one the fleet follows. Targets reach different registries, or a pull-through cache, only when their config images name them.The upatch tree is the only source with selectors: kernel release, kernel build ID, architecture, kernel configuration and node labels. Its reference can be a tag other than
stable. A target moves past an operation that does not select it for good, so labels changed later do not apply operations it skipped before.A tree publication, a segment, holds at most 512 operations.
bpm tree appendseals the segment when it holds--segment-opsoperations, 64 by default, or when the new ones would not fit, and starts one that names it by digest. A target that is behind fetches the sealed segments back to its position, up to the walk limit of Limits.
Deliver packages sets up repositories and the tree.
Collectors#
With an endpoint configured, every target sends one keepalive a minute after the previous one ends, and one request per map of every loaded upatch 5 seconds after the previous export ends, about 12 a minute. A collector serves N targets with M exported maps each about N × (12 × M + 1) requests a minute. A request waits 10 seconds by default and is retried 3 times. See Monitor and export telemetry.
One target#
shirudo sets no limit on the number of upatches a target loads. The limits below decide how far one target goes.
shirudo limits#
Item |
Limit |
When it is reached |
|---|---|---|
Boot restore |
The init record of a boot grows with the restored set: about 1.9 KiB, plus 95 bytes and the name for every restored upatch, in a buffer sized for the set. |
The eventlog limits apply, see the next row. |
Eventlog |
Readers accept at most 8 MiB, across all boots, and the log is never rotated. A load or an unload adds about 330 bytes plus the name, and every boot adds its init record. 100 upatches with 20-character names fill 8 MiB in about 600 boots. |
A load is undone as unmeasured ( |
|
64 KiB, 162 bytes plus the name per upatch: about 360 upatches with 20-character names. |
|
|
8 MiB |
|
Installed packages |
256, and at most 128 upatches per package |
|
BPF signers |
16, the runtime primary and the certificates the config vouches for |
|
Node labels |
64, with keys and values shorter than 256 bytes |
|
Kernel limits#
The kernel sets no limit on the number of BPF programs, maps or links
and charges their memory to the memory cgroup of the loading process,
unless it boots with cgroup.memory=nobpf.
The JIT memory limit, net.core.bpf_jit_limit, refuses only callers
without CAP_BPF. What bounds a target is the attach point.
Attach kind |
Limit |
Constant |
|---|---|---|
|
36 programs per kernel function on x86-64, 37 on arm64 and 38 on
riscv64, counted together for all four kinds. An |
|
|
No limit per tracepoint |
|
|
No limit per site; every attachment is a perf event of its own |
|
|
1,048,576 offsets per link, which shirudo also enforces |
|
|
64 programs per direction on |
|
|
One program. shirudo attaches every |
|
shirudo’s 48 guards are BPF LSM programs on 39 hooks. Nine hooks carry
two of them: bprm_check_security, file_open, inode_link,
inode_mkdir, inode_removexattr, inode_rename,
inode_setxattr, inode_symlink and inode_unlink. On x86-64 an
lsm upatch therefore has 34 places left on those hooks, 35 on the other
30 hooks shirudo uses and 36 on every other hook. shirudo does not count
them: a load that finds the attach point full fails at link_create
with the kernel’s E2BIG, or EBUSY for netfilter, in category
unknown.
One upatch#
Item |
Limit |
|---|---|
|
16 MiB. .upatch format lists the limit of every field. |
Signature |
64 KiB in the kernel, |
Signed loader |
Its instructions and the value of its metadata map together less
than 16 MiB, the size of the buffer the kernel verifies
( |
Each program |
The verifier processes at most 1,000,000 instructions and allows
64 maps ( |
Arena |
4 GiB ( |
Name |
255 characters from |
Map export |
Maps, arenas and serializers and Write a Lua decoder give the serializer and decoder limits. |
Package |
128 upatches, 4096 archive entries and 256 MiB |