Cryptograss:Moods/performance/todo
From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
- ☐Poll under load: who-spoke updated in place, not rebuilt; one rebuild of the emergents' settings per change, not one per tabSecond ramp, after #411 + #412: 10 tabs p95 1.9 s, stopped at 25 tabs (p95 4.9 s). Idle poll 870 → 190 ms.
- ☐Wiki reads off the request path: hooked pages kept until their hook (no short TTLs, warm on change); pronouns and time zones pushed on a preferences saveMoved here from #interfaces at Justin's ask (6 Nov). Preferences aren't page saves, so PageSaveComplete never tells of them.
- ☐Realtime Activity Bar Option A (state-flag registry with heartbeat TTL)The activity line is now the biggest cost left on every poll: 115–155 ms idle, ~500 ms under load (6 Nov).
- ☐Moods page script out to a static file with a hash in its name, so a reload after a deploy that didn't touch it is cached (684 KB inline today)Item 2 of the low-hanging fruit (4 Nov). Item 1, magenta#385, merged and deployed: /api/servers/ went from 0.6–1.4 s to 18 ms (Server-Timing, block 26,350,822).
- ☐Merge maybelle-config:magent/roll-keep-48, then redeploy maybelle and run the PickiPedia VPS playbookroll_keep 48 on both sites (~half a GB a box, gzipped), so the backfill can fill a true 24-hour window and a few days of the week. Two things found while writing it: the wiki box's caddy role only validates and reloads, and Caddy keeps the log file it already opened across a reload, so the new roll_keep would have sat in the Caddyfile unapplied -- that role now restarts when the Caddyfile itself changed. And pickipedia-vps/ansible/playbook.yml is now in ci/test (the syntax check and the task-options check), which nothing covered before. Second commit 32db34fc: a window's
sinceandfullnow mean how far back the box has counted, not the oldest hour that holds something -- seen live on maybelle, where the three hours said 'not full' while the day said 'full'. Third commit 3528dd68 (23 Nov, from Justin's question about the million api.php asks): only a browser is counted as a person -- mwclient, bare node and any unnamed library fell through to 'people', which put 2M asks a week in the readers' column on the wiki -- and each window now names the busiest programs behind its asks. That commit also fixes the ci/test line the second one added: it ran the syntax check from the repository root, where the shared goaccess role isn't on roles_path, so it failed; each playbook is now checked from its own directory, as the deploy runs it. 18 tests, whole ci/test green (exit 0). - ☐Run the PickiPedia VPS playbook: the wiki box still runs the old rollup while maybelle is already fillingChecked 03:45Z: maybelle has finished its catch-up -- catching_up 0, counted since 20 Nov 00:00, 52 hours in the 7-day window and 25 in the day, so the three windows now read differently as meant. pickipedia.xyz's three windows are still empty objects, with no since, no full and no hours: the old rollup. One playbook run carries both the rollup and roll_keep 48.
- ☐Merge magenta:magent/traffic-clients (the stats page draws the new 'Who asked' list), after maybelle-config:magent/roll-keep-48, then redeploy maybelleThe rollup writes the clients list, so that deploy goes first; until it does the list is empty and the page says 'nobody yet'. 12 tests in test_traffic, 2,196 in conversations.tests.
- ☐Decide what to do about the signup and sign-in probes: 14,575 asks at Special:UserLogin and 11,646 at Special:CreateAccount in 46 hours, and no account created since 10 Novmagent, 23 Nov. Anonymous createaccount is open ($wgGroupPermissions), there's no captcha extension installed, and Extension:PickiPediaInvitations is what actually stops them -- so they're burning a full MediaWiki render per probe for nothing. Robots.txt already disallows /index.php, which they ignore. Options, cheapest first: a Caddy rate limit on those two paths; close anonymous createaccount outright so the form short-circuits; leave it (it's ~26k of 1.9M, so it costs PHP rather than bandwidth). If you pick one, magent writes it.
- ☐Find out which of our three mwclient callers is making ~2M asks a week to the wiki's api.phpMeasured 23 Nov off the live GoAccess dashboard: mwclient/0.11.0, 1,991,561 of 3,948,972 requests 12-23 Nov -- half of everything that box serves. None of our three callers sets a user agent (blue_railroad_import/wiki_client.py, delivery-kid/pinning-service's pickipedia_client.py, maybelle/scripts/post-audit-to-wiki.py; the delivery-kid audit cron runs every 30 min), so the log can't tell them apart and the rollup drops addresses. Needs one read of the wiki box's own access log, which needs a key to 5.78.112.39 that this container doesn't hold. The fix after that is one line in each caller: mwclient takes clients_useragent, so 'ours' becomes true by construction instead of by a guessed regex.
- ☐
- ☐Verify live endpoint timings on maybelle after the perf deploysRe-run the 02:15Z timings for /api/moods/ and cold room loads; re-stamp Cryptograss/Moods/Loading and prefetch (research). memory-lane/loadtest/tabs.py (magenta#412) now does the ramp; its second run (6 Nov 19:31Z): 10 tabs p95 1.9 s, stopped at 25.
Done (11)
- ☑The wiki push, its last step: make the secret (openssl rand -hex 32), put it in the vault as memory_lane_wiki_hook_secret and in LocalSettings.local.php on the wiki host as $wgPickiPediaContentMagentaHookSecret; merge maybelle-config#279, redeploy maybelleMoved from #interfaces (6 Nov), where the push item was ticked done with this step still open: /wiki-hooks/ says no WIKI_HOOK_SECRET, #279 is open (checked block 26,358,037). magenta#404 and pickipedia#175 are merged and live; the minute sweep alone serves until then.
- ☑Merge magenta:magent/visitor-polls (a tab with no device polls every 15 s, not 4 and 5), then redeploy maybelleHN/reddit wave, 11-12 Nov. Each visitor from the link is a polling tab; the 6 Nov ramp queued at ~25 of them. Justin: 'a no-brainer'.
- ☑Merge magenta:magent/tidings-premade (release and picture lists rebuilt by the change itself, on a thread; no visitor rebuilds), then redeploy maybellehug-watch, 11 Nov 23:14Z-02:33Z: /api/tidings/ took 4-30 s every ~5 min (the picture scan at PICTURES_KEPT, the release scan at RELEASES_KEPT), on whoever asked. mood_cache.kept: stale-while-revalidate, as /api/servers/ since #385.
- ☑Merge maybelle-config:magent/goaccess (public /stats/ dashboards, no vault step), redeploy maybelle, and run the PickiPedia VPS playbookGoAccess over Caddy's access logs, public at magenta.cryptograss.live/stats/ and pickipedia.xyz/stats/: no addresses, query strings or full referring URLs; sign-in and email-token paths never logged (skip_log). After re's second look (12 Nov).
- ☑After the GoAccess deploy: open both /stats/ pages, see the counts fill and the live updates connect (the --ws-url path is the first suspect if not)Checked 12 Nov 22:20Z: both pages serve, the WebSocket connects and pushes on both, panels as meant (no hosts, referrers, user names, keyphrases). A fake /moods/login/ and Special:ConfirmEmail/ path never showed; a control path beside each did.
- ☑When Caddy first rolls a site's log (100 MB), see that GoAccess keeps counting the new filere's watch item (12 Nov), ANSWERED YES (re, 22 Nov 02:41-02:47Z): GoAccess keeps counting across rolls, measured in a browser on both dashboards — magenta's totals grew 2,993,547→2,993,778 in 37 s and pickipedia's 3,243,652→3,244,103 in 5 min, each with the daily panel covering every day 16-21 Nov, over a log that rolls every ~72 min (≈90 rolls since 14 Nov). The json inside index.html is a snapshot GoAccess wrote at its unit's last start (14 Nov 06:36Z on maybelle, 06:25Z on the wiki box, matching the 06:35:51 in Justin's systemctl read): a browser draws the WebSocket's live numbers over it, so that snapshot's staleness — the whole 'stopped on 14 Nov' reading — was never what the dashboards served. Its dataset reaching back to 12 Nov across that 14 Nov start says some state persists past a restart too (a --db-file somewhere outside /stats/db/); nothing hinges on where.
- ☑If GoAccess stopped counting at the roll: feed it tail --follow=name --retry rather than a path it opens onceNot needed (re, 22 Nov): both dashboards measured growing minute by minute across ~90 rolls since 14 Nov, so the condition never came true. Kept for the record.
- ☑Merge maybelle-config:magent/traffic-rollup and magenta:magent/traffic-windows (in that order), redeploy maybelle, and run the PickiPedia VPS playbookJustin, 22 Nov: the stats as they were are less useful than needed. Each box counts its own Caddy log by the hour and writes 3h/24h/7d beside the dashboard; the stats section draws them: people vs crawlers vs ours, the pages actually read (title kept, so index.php says which page), the post people came from, the links they followed. The rollup must be deployed first: the section reads what it writes.
- ☑Merge maybelle-config:magent/traffic-backfill and magenta:magent/traffic-tips (in that order), redeploy maybelle, and run the PickiPedia VPS playbookJustin, 22 Nov 02:13Z: the three timeframes showed the same numbers, and the descriptions needed tooltips. Both boxes held about 72 minutes, because the rollup's first run reads the live log and the live log is only as old as the last roll. The rollup now reads the rolled logs beside it (one a run) and each window says how far back it reaches; the page draws that line and says what every description counts. Second commit 4526e365: Caddy gzips a rolled log unless roll_uncompressed is set, so the rolled files are .log.gz and the first glob would have found nothing at all; the tail of a log that rolls is now found by time rather than by an inode the gzip has replaced. 13 tests.
- ☑Weigh raising Caddy's roll_keep (10 today) against disk, so the 7-day window can be filled from the rolled logs rather than over a weekre's bound (22 Nov): the backfill reads only what Caddy keeps. At today's volume the logs roll every hour or two, so 10 rolled files is about half a day. Rolled files are gzipped, so a week is roughly 1 GB a box. Justin picked 48 at 03:30Z; the branch is the item below.
- ☑Merge magenta#412 (load test script; a poll stops redoing who-spoke and the emergents' settings), redeploy maybelleFirst run on production (6 Nov) stopped at 5 tabs: poll p50 1.7 s, p95 5 s. Rerun posted 19:31Z, with #411.