Build1 distinct publisher3 min readUpdated
A dev.to walkthrough builds a two-key rotation locally, then fires 2,000 concurrent fetches at the key server so you can read the peak in a 100ms window.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
A walkthrough published on dev.to builds a small HLS stack with rotating AES-128 keys, points a concurrency harness at the key endpoint, and watches every simulated viewer request the same key in the same second [17]. Its premise is worth restating for anyone running live video: key rotation during a stream is standard practice, load-testing the endpoint that serves those keys is not, and that endpoint is the one place in the stack where every viewer makes an identical request at an identical moment [1][2].
The mechanic is in the playlist. An EXT-X-KEY tag applies to every segment that follows it until another EXT-X-KEY shows up [4]. Live viewers are not spread across the asset the way VOD viewers are; they sit within a few seconds of the live edge, refreshing the same playlist, so they all see the new EXT-X-KEY line within the same playlist-refresh interval and all fetch it at once [3].
Reproducing it needs ffmpeg 7.x or 8.x, node 20.x or newer, and openssl, all locally [5]. Generate two 16-byte content keys with openssl rand 16 [6], write a key info file per key with the key URI on the first line and the local key path on the second [7], then segment with -hls_time 4 -hls_playlist_type event and -hls_key_info_file [8]. The output playlist carries METHOD=AES-128 with the key URI and IV, EXTINF entries of 4.000 seconds, and EXT-X-TARGETDURATION:5 [9]. Rotation is then simulated by hand-inserting a second EXT-X-KEY before seg_015 pointing at the other key [10], which places the rotation 60 seconds into the stream [18]. In production your packager emits that tag on whatever rotation interval you configured; the hand edit exists only so you control exactly when the rotation lands [11].
The server side is where the measurement lives. A node http server on 8080 serves the two key files and 404s everything else [12], counts requests into 100ms buckets while pruning anything older than five seconds [13], and prints the peak requests in a 100ms window on SIGINT [15]. In front of the response is a 15ms setTimeout standing in for an entitlement check, because most key endpoints validate a session token, look up an entitlement, maybe hit a database, and that work is the reason the endpoint has a concurrency ceiling at all [14]. Replace 15ms with your own measured figure before you believe any number the harness gives you.
The client harness takes concurrency, defaulting to 2,000, and a jitter value in milliseconds, defaulting to 0, fires everything through Promise.all, and reports latency percentiles alongside ok and failed counts [16]. With jitter at zero, every request starts in the same tick, which is the worst case by construction [20]; 2,000 arrivals inside one 100ms bucket is a 20,000 requests-per-second instantaneous rate against an endpoint doing database work [19].
The walkthrough goes on to promise three mitigations that work on players shipping today, plus where the newer EXT-X-PRELOAD-HINT:TYPE=KEY tag fits [17]. That half is not in the material in front of me, so I will not name three. The reproduction half stands on its own: it is a two-hour job, and it converts an untested endpoint into a measured one.
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
The walkthrough states it will build the rotating-key HLS setup, point a concurrency harness at the key endpoint, then apply three mitigations that work on players shipping today and look at where the new EXT-X-PRELOAD-HINT:TYPE=KEY tag fits.
Key rotation during a live stream is standard practice; what is not standard is load-testing the endpoint that serves those keys.
The key endpoint is the one endpoint in the stack where every viewer makes an identical request at an identical moment.
Real live viewers are all within a few seconds of the live edge, refreshing the same playlist, so they all see the new EXT-X-KEY line within the same playlist-refresh interval and all fetch the key at once.
An EXT-X-KEY tag applies to every segment that follows it until another EXT-X-KEY tag shows up.
The walkthrough requires ffmpeg 7.x or 8.x, node 20.x or newer, and openssl, and everything runs locally.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Reproducible local demo, single author, synthetic load
The mechanism claims are backed by complete, runnable listings — openssl key generation, the ffmpeg segmenting command with -hls_key_info_file, the emitted playlist tags, an instrumented Node key server, and the stampede harness — plus two printed measurement runs whose ratio is the argument. Evidence quality is capped because it is one publisher, one machine, a 15ms setTimeout standing in for real entitlement work, and no production or CDN-scale telemetry; the author explicitly says the absolute numbers will differ. The captured text also truncates before the promised mitigations and EXT-X-PRELOAD-HINT:TYPE=KEY analysis.
No adoption signal in supplied sources
The single source is a tutorial. It contains no release, deployment, benchmark-of-record, pricing, licensing or usage disclosure — no numbers on how many operators rotate keys, jitter key fetches, or ship the EXT-X-PRELOAD-HINT:TYPE=KEY tag. hls.js error behavior is described but no adoption or version data is given, so adoption cannot be scored without inventing facts.
Technically sober, prevalence framing overstated
The technical body is unusually restrained: it publishes its own code, warns that the reader's numbers will differ, and tells readers to trust their own endpoint rather than the author's figures. The overstatement is confined to the framing — 'almost nobody tests it' and 'not standard' assert an industry-wide practice gap with no survey, telemetry, or third-party evidence, and the 20,000 requests-per-second arithmetic is a conditional peak rather than something the author's own 1,180ms run demonstrates. Net gap is small and positive.
Individual developer post, no product being sold
The material is a personal walkthrough on dev.to under an individual author byline with no vendor, sponsor, funding, or commercial product named, and no paid tool or service recommended in the captured text. The residual incentive is the ordinary engagement and portfolio pull of developer-platform publishing, which favors a dramatic framing ('stampede', 'almost nobody tests it') around otherwise self-checking technical content.
Mechanics solid, generalization and adoption unverified
High confidence in the artifact-level facts because the code, commands, playlist output and run transcripts are all reproduced verbatim and internally consistent. Confidence is held down by single-publisher sourcing, absence of any adoption evidence, a synthetic latency stand-in, and a body truncated before the mitigations it advertises.
build
A year of green backups hid 7 of 10 missing Android signing keys1 distinct publisher
build
Live video is two protocol decisions, not one, and your CDN is fighting your latency target1 distinct publisher
build
A GAN beauty filter is a device budget allocation, not a feature toggle1 distinct publisher
build
The optional EntityManager is the bug: moving the transaction boundary into AsyncLocalStorage1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 17, 2026