Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
57b9433
Add x-gnosis framework (TypeScript/Bun)
buley Mar 17, 2026
097b91c
Add gnosis-uring framework (Rust, io_uring)
buley Mar 17, 2026
0f7a6a5
fix(gnosis-uring): TechEmpower compliance — dynamic Content-Length + …
buley Mar 17, 2026
73fdb3c
perf(gnosis-uring): replace .to_string() with itoa for zero-alloc Con…
buley Mar 17, 2026
3eba969
feat(x-gnosis): add all 7 TechEmpower test types
buley Mar 20, 2026
3f5a01a
fix(x-gnosis): spec compliance audit — Date header, Content-Type, doc…
buley Mar 20, 2026
94308dc
test(x-gnosis): add 50 TechEmpower spec compliance tests
buley Mar 20, 2026
e31b23a
chore: remove unit tests from benchmark entry
buley Mar 20, 2026
657fe7c
feat(gnosis-uring): add PostgreSQL support for all 7 TechEmpower tests
buley Mar 20, 2026
3fc97f2
feat(x-gnosis): migrate from Bun to Node.js 22
buley Mar 20, 2026
91df5f6
fix(gnosis-uring,x-gnosis): read PGPORT env var for local testing
buley Mar 20, 2026
e63f561
fix(gnosis-uring): fix SO_REUSEPORT for multi-thread whip-snaps
buley Mar 20, 2026
a06ea7c
perf(gnosis-uring): revert tokio-postgres, keep sync + whip-snaps
buley Mar 20, 2026
6c8eb02
perf(gnosis-uring): raw PG wire protocol with cannon-style pipelining
buley Mar 20, 2026
df51289
perf(gnosis-uring): buffered I/O + prepared fortune statement
buley Mar 20, 2026
3b37bd4
perf(gnosis-uring): binary PG results + zero-alloc message reads
buley Mar 20, 2026
d4288bf
perf(gnosis-uring): HTTP→PG pipeline rotation + reusable buffers
buley Mar 20, 2026
79bb91b
perf(gnosis-uring): Unix domain socket + enum dispatch (no Box<dyn>)
buley Mar 20, 2026
48383c2
perf(gnosis-uring): UDS enum dispatch + zero-alloc response builders
buley Mar 20, 2026
cb2bb0f
perf(gnosis-uring): fan-out PG connection pool for multi-query endpoints
buley Mar 20, 2026
c66b9c6
perf(gnosis-uring): poll-based RACE + thread oversubscription testing
buley Mar 20, 2026
ab80de9
feat(gnosis-uring): Lord of the Uring — async DB queries via io_uring
buley Mar 20, 2026
082c45b
ci(gnosis-uring): Cloud Build benchmark config for Linux io_uring tes…
buley Mar 20, 2026
11ff75d
fix(gnosis-uring): Linux compat (sa_family_t) + Cloud Build fixes
buley Mar 20, 2026
1a621c7
fix(gnosis-uring): blocking DB in io_uring path (async DB deferred)
buley Mar 20, 2026
caf7bfd
fix(gnosis-uring): remove async PG dead code from io_uring path
buley Mar 21, 2026
55e657e
perf(gnosis-uring): use whip-snaps (not io_uring) for TechEmpower
buley Mar 21, 2026
78d2907
fix(gnosis-uring): remove remaining async PG references from event loop
buley Mar 21, 2026
3d8076c
fix: remove last pg_state reference from Conn::new
buley Mar 21, 2026
dc40184
fix(gnosis-uring): Cloud Build PG auth — use trust instead of peer
buley Mar 21, 2026
51a0218
fix(gnosis-uring): reduce PG pool to 2, bump max_connections to 200
buley Mar 21, 2026
27931fe
feat(gnosis-uring): FORK/RACE/FOLD on the development itself
buley Mar 21, 2026
d67908b
refactor(x-gnosis): topology-driven server replaces switch statement
buley Mar 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frameworks/Rust/gnosis-uring/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
133 changes: 133 additions & 0 deletions frameworks/Rust/gnosis-uring/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions frameworks/Rust/gnosis-uring/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "gnosis-uring"
version = "0.1.0"
edition = "2021"
description = "Topology-driven HTTP server: four primitives (fork/race/fold/vent) mapped to io_uring"
license = "MPL-2.0"

[[bin]]
name = "gnosis-uring"
path = "src/main.rs"

[dependencies]
itoa = "1"
libc = "0.2"
flate2 = "1"
brotli = "7"
nanorand = { version = "0.7", default-features = false, features = ["std", "wyrand"] }

[target.'cfg(target_os = "linux")'.dependencies]
io-uring = "0.7"

[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true
panic = "abort"
23 changes: 23 additions & 0 deletions frameworks/Rust/gnosis-uring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# gnosis-uring

Topology-driven HTTP server with four primitives mapped directly to io_uring:

| Primitive | io_uring | Purpose |
|-----------|----------|---------|
| FORK | batch SQE submission | Accept connections, resolve files, race codecs |
| RACE | first CQE wins + cancel | Cache vs mmap vs disk, smallest codec wins |
| FOLD | gather CQEs | Headers + body, multi-frame responses |
| VENT | close fd, cancel ops | Timeout, error, connection close |

Features:
- Per-chunk Laminar codec racing (identity/gzip/brotli/deflate, smallest wins)
- SQPOLL mode (zero syscalls in hot path)
- Pinned buffers for stable io_uring SQE pointers
- UDP Aeon Flow transport (10-byte frames, no TCP overhead)

Whitepaper: https://forkracefold.com/

## Test URLs

- Plaintext: `http://localhost:8080/plaintext`
- JSON: `http://localhost:8080/json`
44 changes: 44 additions & 0 deletions frameworks/Rust/gnosis-uring/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"framework": "gnosis-uring",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add yourself to the maintainers in the benchmark_config.json.

So with any change or marked as broken, you will be notified.

Example:

{
"framework": "quarkus",
"maintainers": ["franz1981", "Sanne", "geoand"],
"tests": [
{
"default": {

"tests": [{
"default": {
"dockerfile": "gnosis-uring-uring.dockerfile",
"json_url": "/json",
"plaintext_url": "/plaintext",
"port": 8080,
"approach": "Realistic",
"classification": "Platform",
"language": "Rust",
"platform": "gnosis-uring",
"webserver": "gnosis-uring",
"os": "Linux",
"database_os": "Linux",
"database": "None",
"display_name": "gnosis-uring",
"notes": "Topology-driven server: four primitives (fork/race/fold/vent) mapped to io_uring. Pure io_uring mode for plaintext/JSON (no DB).",
"versus": "may-minihttp"
},
"postgresql": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"query_url": "/queries?queries=",
"update_url": "/updates?queries=",
"fortune_url": "/fortunes",
"cached_query_url": "/cached-queries?count=",
"port": 8080,
"approach": "Realistic",
"classification": "Platform",
"database": "Postgres",
"language": "Rust",
"platform": "gnosis-uring",
"webserver": "gnosis-uring",
"os": "Linux",
"database_os": "Linux",
"orm": "Raw",
"display_name": "gnosis-uring [PostgreSQL]",
"notes": "Topology-driven server with PostgreSQL: fork/race/fold/vent mapped to io_uring.",
"versus": "may-minihttp"
}
}]
}
139 changes: 139 additions & 0 deletions frameworks/Rust/gnosis-uring/cloudbuild-benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
steps:
# Step 1: Build gnosis-uring
- name: 'rust:1.83-bookworm'
id: build
dir: '.'
entrypoint: bash
args:
- -c
- |
cargo build --release 2>&1
ls -lh target/release/gnosis-uring
echo "Binary size: $(du -h target/release/gnosis-uring | cut -f1)"
file target/release/gnosis-uring

# Step 2: Benchmark with PostgreSQL
- name: 'debian:bookworm'
id: benchmark
dir: '.'
entrypoint: bash
args:
- -c
- |
set -e
apt-get update && apt-get install -y --no-install-recommends \
postgresql postgresql-client liburing2 wrk curl procps

mkdir -p /tmp/www
echo '<html><body>Hello</body></html>' > /tmp/www/index.html

# Configure PostgreSQL for benchmark
echo "local all all trust" > /etc/postgresql/15/main/pg_hba.conf
echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/15/main/pg_hba.conf
echo "host all all ::1/128 trust" >> /etc/postgresql/15/main/pg_hba.conf
# Bump max_connections for 32 threads × 3 conns/thread = 96
sed -i 's/max_connections = 100/max_connections = 200/' /etc/postgresql/15/main/postgresql.conf

# Start PostgreSQL
pg_ctlcluster 15 main start || true
sleep 3

# Create TechEmpower database
su - postgres -c "createuser benchmarkdbuser" || true
su - postgres -c "psql -c \"ALTER USER benchmarkdbuser WITH PASSWORD 'benchmarkdbpass';\""
su - postgres -c "createdb -O benchmarkdbuser hello_world" || true

cat > /tmp/seed.sql << 'SEEDEOF'
CREATE TABLE IF NOT EXISTS world (id integer PRIMARY KEY, randomnumber integer NOT NULL DEFAULT 0);
CREATE TABLE IF NOT EXISTS fortune (id integer PRIMARY KEY, message varchar(2048) NOT NULL);
INSERT INTO world (id, randomnumber) SELECT s, floor(random() * 10000 + 1)::int FROM generate_series(1, 10000) AS s ON CONFLICT DO NOTHING;
INSERT INTO fortune (id, message) VALUES
(1, 'fortune: No such file or directory'),
(2, 'A computer scientist is someone who fixes things that aren''t broken.'),
(3, 'After enough decimal places, nobody gives a damn.'),
(4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1'),
(5, 'A computer program does what you tell it to do, not what you want it to do.'),
(6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen'),
(7, 'Any program that runs right is obsolete.'),
(8, 'A list is only as strong as its weakest link. — Donald Knuth'),
(9, 'Feature: A bug with seniority.'),
(10, 'Computers make very fast, very accurate mistakes.'),
(11, E'<script>alert("This should not be displayed in a browser alert box.");</script>'),
(12, 'フレームワークのベンチマーク')
ON CONFLICT DO NOTHING;
GRANT ALL ON TABLE world TO benchmarkdbuser;
GRANT ALL ON TABLE fortune TO benchmarkdbuser;
SEEDEOF
Comment on lines +50 to +66
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amic no anam be !!!
Again ??


su - postgres -c "psql -d hello_world -f /tmp/seed.sql"

echo ""
echo "══════════════════════════════════════════════════════════════"
echo "Lord of the Uring — GCP Cloud Build (bare metal Linux)"
echo "══════════════════════════════════════════════════════════════"
echo "CPU: $(lscpu | grep 'Model name' | sed 's/.*: *//')"
echo "Cores: $(nproc)"
echo "Kernel: $(uname -r)"

# Start gnosis-uring with multi-threaded whip-snaps (best for DB)
DBHOST=localhost ./target/release/gnosis-uring \
--port 8080 --root /tmp/www --threads 0 &
sleep 3

# Verify
echo "=== Verify ==="
curl -s http://localhost:8080/plaintext && echo ""
curl -s http://localhost:8080/json && echo ""
curl -s http://localhost:8080/db && echo ""
curl -s "http://localhost:8080/queries?queries=3" && echo ""
curl -s http://localhost:8080/fortunes | head -c 200 && echo ""
curl -s "http://localhost:8080/cached-queries?count=2" && echo ""

# Warmup
echo ""; echo "=== Warmup ==="
wrk -t16 -c512 -d5s http://localhost:8080/plaintext > /dev/null 2>&1
wrk -t16 -c512 -d5s http://localhost:8080/db > /dev/null 2>&1
echo "Done."; echo ""

# All 7 tests
for test in plaintext json db "queries?queries=20" fortunes "updates?queries=20" "cached-queries?count=20"; do
name=$(echo "$test" | cut -d'?' -f1 | tr '[:lower:]' '[:upper:]')
echo "=== $name — 16t, 512c, 15s ==="
wrk -t16 -c512 -d15s --latency "http://localhost:8080/$test"
echo ""
done

# High concurrency
echo "=== HIGH CONCURRENCY (1024c) ==="
for test in plaintext json db "queries?queries=20" fortunes "updates?queries=20" "cached-queries?count=20"; do
name=$(echo "$test" | cut -d'?' -f1 | tr '[:lower:]' '[:upper:]')
echo "=== $name (1024c) ==="
wrk -t16 -c1024 -d15s "http://localhost:8080/$test" | grep "Requests/sec"
done

echo ""
echo "=== HTTP PIPELINING (pipeline depth 16) ==="
cat > /tmp/pipeline.lua << 'LUAEOF'
init = function(args)
local r = {}
for i = 1, 16 do
r[i] = wrk.format(nil, "/plaintext")
end
req = table.concat(r)
end

request = function()
return req
end
LUAEOF
echo "=== PLAINTEXT PIPELINED ===" && wrk -t16 -c512 -d15s -s /tmp/pipeline.lua http://localhost:8080/plaintext | grep "Requests/sec"

echo ""
echo "══════════════════════════════════════════════════════════════"
echo "Lord of the Uring — benchmark complete"
echo "══════════════════════════════════════════════════════════════"

timeout: '1800s'
options:
machineType: 'E2_HIGHCPU_32'
diskSizeGb: 50
Loading