feat: Infrastructure optimization for millions of TPS (all 14 services)#35
Merged
munisp merged 2 commits intoJun 20, 2026
Merged
Conversation
Infrastructure optimizations: - PostgreSQL: 64GB shared_buffers, zstd WAL, parallel query (32 workers), PgBouncer (20K connections pooled to 500), aggressive autovacuum - Kafka: 5-broker KRaft, zstd compression, 24 partitions, ZGC JVM, batch producer (10K msg/batch), exactly-once transactions - Redis: I/O threading (8 threads), 48GB maxmemory, LFU eviction, cluster mode, pipeline batching - TigerBeetle: 6-node cluster (3+3), 8GB grid cache, 8190 batch size - APISIX: 10K req/s rate limit, 65K worker connections, upstream keepalive 320, HTTP/2, gzip compression - OpenSearch: 30s refresh, async translog, hot-warm-cold ISM lifecycle, 10-shard transaction index, bulk API optimized templates - Temporal: 4096 history shards, 16 task queue partitions, 10K RPS limits, 65K history cache, 30K persistence QPS - Mojaloop: MySQL (cannot use Postgres - Knex.js uses MySQL-specific SQL), ProxySQL read/write splitting, 4 central-ledger replicas, 96GB InnoDB buffer pool, batch settlement (1000/batch), connection pool (100/instance) - Fluvio: 16MB batch, zstd compression, 12 partitions, 3 replicas - Dapr: gRPC protocol, bulk publish/subscribe, 1% trace sampling, Kafka batch producer (10K msg, 16MB), Redis pool (200 connections) - Permify: 200 DB connections, 5min cache TTL, gRPC, circuit breaker, 4 replicas, HPA to 20 - Lakehouse: Bronze/Silver/Gold medallion, daily partitioning with BRIN indexes, COPY protocol ingestion, concurrent materialized view refresh High-performance polyglot services: - Go: goroutine pool, sync.Pool zero-alloc, batch accumulator, circuit breaker per downstream, bounded concurrency - Rust: tokio + crossbeam lock-free channels, DashMap idempotency cache, batch pipeline with configurable flush, TigerBeetle batch client with double-entry helper - Python: uvloop + httptools, batch processor with async flush, vectorized aggregation engine, lakehouse ETL pipeline Kernel tuning: TCP BBR, 65K backlog, NVMe scheduler, huge pages, io_uring Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…os go.mod Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Contributor
Author
Original prompt from Patrick
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Production-grade high-throughput tuning for all 14 infrastructure services, plus polyglot transaction processing engines in Go, Rust, and Python. Target: millions of transactions per second.
Supersedes #34 (closed due to merge conflict).
Mojaloop — MySQL, NOT PostgreSQL
Mojaloop's Knex.js migrations use MySQL-specific syntax (
AUTO_INCREMENT,ENUM,ON DUPLICATE KEY UPDATE). Postgres is not supported without forking. Strategy: aggressive MySQL tuning + ProxySQL pooling.Infrastructure configs (35 files, +4,359 lines)
shared_buffers, 32 parallel workers, zstd WAL, PgBouncer 20K→500Polyglot high-performance engines
Go (
services/go/high-perf-tx-engine/): Goroutine pool withsync.Poolzero-allocation,BatchAccumulator(8190/batch, 10ms flush), circuit breakers per downstream.Rust (
services/rust/high-perf-tx-engine/): Tokio + crossbeam lock-free channels,DashMapidempotency cache, atomic metrics.services/rust/tigerbeetle-batch-client/:DoubleEntryBuilderfor GL transfers with fee/commission legs.Python (
services/python/high-perf-analytics/): uvloop + httptools, asyncBatchProcessorwith configurable flush,AggregationEnginewith percentile computation,LakehouseOptimizerwith Bronze→Silver ETL and Gold materialized views.Bug fix
github.com/lib/pqdependency inservices/go/mojaloop-connector-pos/go.modKernel tuning
infra/kernel-tuning.sh: TCP BBR, 65K backlog, NVMe scheduler, huge pages for PostgreSQL, THP disabled,io_uringAIO limit.Test Results (12/12 passed)
All YAML/TOML/JSON configs parse, Go/Rust/Python code compiles, 8 key tuning values verified, TypeScript integrity confirmed (8 pre-existing errors only), test suite 4,286 passed with 6 pre-existing failures.
Link to Devin session: https://app.devin.ai/sessions/3ebd42bf0430422a9a2bd85ed9f9cd4c
Requested by: @munisp