The browser tests drive one person against a handful of feeds, one request at a time, and cannot
show what production's load does. node tests/load/run.js builds a release binary, serves 1,500
generated feeds from itself, starts a daemon of its own under /tmp/ipx-load, seeds a hundred
listeners with thirty feeds each and four downloaded files, and runs four k6 scripts, with
`ipx status` -- the healthcheck -- run every second and failing the run at its 5s timeout:
browse 25 people at once: feed list, All Subscriptions, a feed, a search, the Directory,
a feed's page in it
listening 100 players saving positions every second and marking items read while scans write;
each reads its own state back, which must be as it left it
media 50 listeners seeking: every range checked byte for byte against the served file
signin a flood of wrong passwords while others browse, and the gap between refusing a
known name and an unknown one
Each budget is about twice what it measures now. Getting here found #135 (SQLite waiting for the
disk after every write, a first scan of 1,500 feeds estimated at 50 minutes, now 27s), #136
(SQLite's single connection, left open), #137 and #138 (fixed in the commit before this). k6 is
installed from its own signed apt repository by /src/install.sh, outside this repository.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
819 B
JavaScript
17 lines
819 B
JavaScript
// What the load tests share. Each virtual user is a listener of its own, signed in by name with
|
|
// the header the scratch daemon trusts from 127.0.0.1, as production trusts Cloudflare Access's.
|
|
export const BASE = __ENV.BASE;
|
|
export const USERS = Number(__ENV.USERS || 100);
|
|
export const FEEDS = Number(__ENV.FEEDS || 1500);
|
|
// Each generated feed has this many items; see run.js.
|
|
export const ITEMS = 20;
|
|
|
|
export const as = (name, tag) => ({
|
|
headers: { 'X-Load-User': name, 'Content-Type': 'application/json' },
|
|
tags: { name: tag },
|
|
});
|
|
/// The listener this virtual user is, one of the hundred run.js seeded, thirty feeds each.
|
|
export const me = () => `load-${(__VU - 1) % USERS}`;
|
|
export const pick = a => a[Math.floor(Math.random() * a.length)];
|
|
export const feedId = n => `gen-${String(n).padStart(4, '0')}`;
|