Repository navigation
Rust conversion - #10
Merged
Merged
Conversation
Replace the Python app (main.py, bg_indexer.py, src/*.py) with a single Rust binary. Same features and data formats: an existing atlas.db and config.json keep working. - NNTP client on tokio + rustls with per-server connection pools, XFEATURE COMPRESS GZIP, and failover across servers - usenet_servers in config.json: every server indexes at once (groups spread by connections, cursors kept per server), with `index: false` for article-only/block accounts; fill servers that reject GROUP are detected automatically and connection limits adapt to what the provider allows - background indexer as an async scheduler: many groups in parallel, XOVER slices streamed and saved as they arrive, live config reload - Newznab API answers search/tvsearch/movie/music/book plus caps/get, listens on api_host; release names (incl. par2/nfo names) are in the FTS index so searches stay fast on large databases - subject parser kept identical to the Python one (parity test) - Docker files under docker/ (PUID/PGID aware entrypoint), CI for Linux/macOS/Windows, justfile, Rust 1.99 toolchain - tests: unit, python parser parity, mock NNTP end to end (failover, parallel groups, compression, provider quirks) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rewrite around the Rust version: install with rustup/just, binaries from tagged releases, data compatible with the Python version - full config.json reference: usenet_servers (host, login, port, ssl, connections, priority, index, compress), indexing settings (batch_size, request_size, parallel_groups), api_host/api_port/api_key, live reload, provider quirks, measuring connection limits - Newznab API: tvsearch/movie/music/book, id-only searches, errors, Prowlarr / NZBHydra2 setup - Docker files under docker/, PUID/PGID, env vars, SABnzbd now optional - development: just recipes, CI, source layout - add .env.example (loaded by the justfile); selftest help mentions every server Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Storage - Releases and articles move out of atlas.db into 8 shard files (atlas.s0.db .. atlas.s7.db) split by group, each with its own writer thread. atlas.db keeps the group cursors and the release id counter. Release ids are seq * 8 + shard: still newest first across shards, and an id says which shard holds it. - Compact article layout: one files row per file (the subject the NZB uses plus the part bitmap), one segments row per article keyed (file, message-id) in a WITHOUT ROWID table. About a quarter of the space; NZBs come out byte for byte the same. - Message-id domains shared by 3+ articles go in a dictionary, made up per-article domains are stored whole. Saving checks both forms so an article is never stored twice. - Searches run across all shards in one query (or the group's shard). - One time conversion of an existing database when the indexer starts (or atlas --convert): parallel readers, staging table sorted into place, an NZB/stats check against the old database before the swap, resumable at the check, old file kept as atlas.old.db. - atlas --compact rewrites the shards smaller (drops single use domains and free space), checking each copy before it replaces the original. - Bundled SQLite built without its process wide memory and page cache locks (LIBSQLITE3_FLAGS), which serialized the writer threads. - WAL handled by the writers between transactions instead of blocking truncate checkpoints that stalled writing for ~20s at a time. Measured on a 512GB database: 138.5GB after conversion and compaction, indexing at ~111k headers/s vs ~41k before. Stats dashboard (menu 8) - Overview, Backfill, Content, Servers and Bottleneck pages: CPU, RAM, headers/s graph, backfill progress and ETA, posting rates and history, file type and NZB counts, per server traffic, and what limits indexing right now (writers, connections, CPU) from always on load counters. - Live dashboard graphs headers/s from 10s rate bins. Indexer - Stopping drops requests still in flight (their connections are discarded, cursors dont move) instead of waiting for a stuck reply. - Per group article ranges and dated ends recorded for the dashboard. Also: proof of concept benchmarks (poc_sqlite_1, poc_sqlite_2, examples/bench_writes.rs), tests for conversion, compaction, shards and stopping, README updates with TUI screenshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check here for optimization: Appz4Fun#1
This is a lot faster.