rust-epoll-jeany: Rust, epoll, in-memory store, group commit #4

Merged
pxc1984 merged 4 commits from Mr-Jeany/posvyat-challenge:rust-epoll-jeany into master 2026-11-07 22:10:14 +00:00
Contributor

Посылка submissions/rust-epoll-jeany — Rust 1.89, без фреймворков: один поток, edge-triggered epoll
для HTTP и Postgres, свой HTTP/1.1 и клиент протокола Postgres (rustls, SCRAM-SHA-256).

  • База, кроме содержимого файлов, загружается в память на старте (~2 с, параллельно, упакованно)
    и пишется насквозь: чтения без запросов к БД, ответ на запись — после коммита.
  • Групповой коммит: всё накопленное — одна транзакция за один круг до базы.
  • Большие таблицы — компактные записи в mmap-файлах в $HOME/.store (как LMDB).

Локально (Postgres 18 + PgBouncer из dev/, +34 мс до PgBouncer, 1 CPU / 512 МБ):
test/test.sh 137/137; 16 000 VU — p95 48 мс, p99 69 мс, ошибок 0.002%, пик anon ~2.4 МБ.
Подробности — в README посылки.

🤖 Generated with Claude Code

Посылка `submissions/rust-epoll-jeany` — Rust 1.89, без фреймворков: один поток, edge-triggered epoll для HTTP и Postgres, свой HTTP/1.1 и клиент протокола Postgres (rustls, SCRAM-SHA-256). - База, кроме содержимого файлов, загружается в память на старте (~2 с, параллельно, упакованно) и пишется насквозь: чтения без запросов к БД, ответ на запись — после коммита. - Групповой коммит: всё накопленное — одна транзакция за один круг до базы. - Большие таблицы — компактные записи в mmap-файлах в $HOME/.store (как LMDB). Локально (Postgres 18 + PgBouncer из dev/, +34 мс до PgBouncer, 1 CPU / 512 МБ): test/test.sh 137/137; 16 000 VU — p95 48 мс, p99 69 мс, ошибок 0.002%, пик anon ~2.4 МБ. Подробности — в README посылки. 🤖 Generated with Claude Code
submissions/rust-epoll-jeany: Rust, epoll, in-memory store, group commit
Some checks failed
challenge / find (pull_request_target) Failing after 4s
5d2f1e8b93
One thread, one edge-triggered epoll loop for HTTP and Postgres; own HTTP/1.1
and Postgres wire client (rustls TLS, SCRAM). The whole database except file
contents is loaded at start and written through; writes are group-committed
as one transaction per round trip. Big tables live in file-backed mappings.

Locally: test/test.sh 137/137; 16k VUs at 34 ms DB RTT, p95 48 ms, p99 69 ms,
peak anon ~2.4 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Contributor

повесьте сюда тег фулл llm плиз

повесьте сюда тег фулл llm плиз
pxc1984 force-pushed rust-epoll-jeany from 5d2f1e8b93
Some checks failed
challenge / find (pull_request_target) Failing after 4s
to 9323ca7286
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 9m48s
2026-10-29 19:47:27 +00:00
Compare
Owner

@Mr-Jeany обновил ветку

@Mr-Jeany обновил ветку
rust-epoll-jeany: writer pool, prefetched files, no disk writes under load
Some checks failed
challenge / find (pull_request_target) Failing after 3s
bb79ba7934
The smoke run on nki had a slow tail (p95 583 ms at 1000 VUs, median 6.7 ms)
while CPU and memory were idle. Removed every source of it that differs from
the local setup:

- tables in anonymous memory by default (STORE=file keeps the old mappings):
  write faults on file pages can stall the single thread on a slow disk;
  MADV_NOHUGEPAGE so THP does not inflate the small vectors
- 12 writer connections: any idle one takes the queued writes, writes about
  one student stay in order; a write waits for one commit, not two
- assignment files prefetched right after start in 1 MB batches, kept in a
  pwrite'd file read through a read-only mapping
- reconnects on a thread, the loop never blocks on a handshake
- stats line in the journal every 10 s (batch times, loop stalls, page faults)

Locally: test/test.sh 137/137; 16k VUs p95 41 ms; with 100 ms commits p95
102 ms; restart and PgBouncer-restart consistency checks identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pxc1984 force-pushed rust-epoll-jeany from bb79ba7934
Some checks failed
challenge / find (pull_request_target) Failing after 3s
to 230d4eae93
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 7m36s
2026-10-29 21:42:57 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from 230d4eae93
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 7m36s
to d1a5066917
All checks were successful
challenge / find (pull_request_target) Successful in 2s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 6m57s
2026-10-29 23:08:26 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from d1a5066917
All checks were successful
challenge / find (pull_request_target) Successful in 2s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 6m57s
to 8878914a4b
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 25m57s
2026-10-29 23:53:24 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from 8878914a4b
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 25m57s
to 16f0abac56
All checks were successful
challenge / find (pull_request_target) Successful in 4s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 36m6s
2026-10-30 07:55:08 +00:00
Compare
rust-epoll-jeany: rerun the benchmark
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 29m9s
41b9431a91
Empty commit to start the pipeline again (on the other runner).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pxc1984 force-pushed rust-epoll-jeany from 41b9431a91
All checks were successful
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 29m9s
to f1f251cf73
All checks were successful
challenge / find (pull_request_target) Successful in 1s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 50m16s
2026-11-02 18:19:34 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from f1f251cf73
All checks were successful
challenge / find (pull_request_target) Successful in 1s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 50m16s
to c1c145a824
All checks were successful
challenge / find (pull_request_target) Successful in 2s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 20m33s
2026-11-03 08:03:41 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from c1c145a824
All checks were successful
challenge / find (pull_request_target) Successful in 2s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 20m33s
to 6ad04e28d6
All checks were successful
challenge / find (pull_request_target) Successful in 2s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 20m33s
2026-11-03 08:48:08 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from 6ad04e28d6
All checks were successful
challenge / find (pull_request_target) Successful in 2s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 20m33s
to 4168614932
Some checks failed
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Has been cancelled
2026-11-03 11:05:21 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from 4168614932
Some checks failed
challenge / find (pull_request_target) Successful in 3s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Has been cancelled
to 0dd420f0a0
Some checks failed
challenge / find (pull_request_target) Successful in 1s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Has been cancelled
2026-11-03 11:14:57 +00:00
Compare
pxc1984 force-pushed rust-epoll-jeany from 0dd420f0a0
Some checks failed
challenge / find (pull_request_target) Successful in 1s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Has been cancelled
to 967a71a197
Some checks failed
challenge / find (pull_request_target) Successful in 1s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Has been cancelled
2026-11-03 11:46:01 +00:00
Compare
rust-epoll-jeany: keep no uploaded file contents in memory
Some checks failed
challenge / find (pull_request_target) Has been cancelled
b7d80eb15f
Uploads stayed in anonymous memory for the life of the process (640 B each at
~4k uploads/s), so the 2M-user hold ran out of the 1 GB limit after ~200 s.
Submission file downloads now always read the committed row from the database,
batched like the seeded files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pxc1984 force-pushed rust-epoll-jeany from b7d80eb15f
Some checks failed
challenge / find (pull_request_target) Has been cancelled
to 38096973c0
All checks were successful
challenge / find (pull_request_target) Successful in 1s
challenge / run (submissions/rust-epoll-jeany) (pull_request_target) Successful in 20m8s
2026-11-03 12:20:58 +00:00
Compare
pxc1984 merged commit 8f45d3279d into master 2026-11-07 22:10:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cu3rd/posvyat-challenge!4
No description provided.