Tag: go
All the articles with the tag "go".
Go's garbage collector: GOGC, GOMEMLIMIT and Green Tea, measured
One allocation-heavy Go 1.27 program on a 4-vCPU Linux VM: reading a gctrace line, what GOGC=50, 100 and 400 do to throughput and memory, GOMEMLIMIT with GOGC=off, and the old collector against Green Tea over five runs each, with the code to repeat it.
Go scheduler: how a million goroutines fit on five threads
One Go 1.27 program keeps 1,000,001 goroutines alive on a 4-vCPU Linux VM with five OS threads. The G, M and P model, run queues and work stealing in a live schedtrace, async preemption, and the one case where Go starts a thousand threads, with the programs to repeat each step.
Go escape analysis: reading -gcflags=-m on a small game server
Which Go values the compiler moves to the heap, and the exact message it prints for each case: returned pointers, maps, goroutines, fmt.Println, callbacks in Go 1.26 vs 1.27, 64 KB and 128 KB size limits, and the 32-byte buffer for variable-size make. With benchmarks and a heap profile.
Redis 8.10 vs Valkey 9.1 under load: the same Go app, the same 4-core machine
Redis 8.10.3 and Valkey 9.1.3 from their official images with default settings, behind one Go app, pushed by k6 from 10,000 to 45,000 requests per second. Peak throughput, latency per step, per-thread CPU and memory, with io-threads 1 and 3, plus the scripts to repeat it.
AWS IAM for a new account: root MFA, a budget, and an access key that needs a phone
Lock down a fresh AWS account from the CLI: check the root user, add a $10 budget alert, then build a developers group, a no-console user and an MFA-protected developer role. Then test it with the key as if it had leaked, prove that a deny beats an allow, and call AWS from Go without a key in the code.
Go encoding/json v1 vs v2 under load: Go 1.26, Go 1.27 and MarshalWrite
The same notes API built three ways (encoding/json on Go 1.26, the same code on Go 1.27, and encoding/json/v2) and loaded with k6 on a 2 vCPU DigitalOcean machine. Requests per second, p95 and p99, CPU profiles, and why MarshalWrite made the list endpoint slower here.
Postgres vs MySQL under load: reads, writes, updates and one open transaction
PostgreSQL 18 and MySQL 9.7 LTS behind the same Go shop on identical 2 vCPU machines, loaded with k6 until each one fails. Every run's result, the settings, why secondary index lookups cost InnoDB more, HOT updates, and the long transaction that turned the result around.
Postgres vs SQLite under load: where each one stops on one machine
PostgreSQL 18 and SQLite 3.53 behind the same Go shop on identical 2 vCPU machines, loaded with k6 until they pass their limits. All result tables, the syscall and lock measurements, the single writer pool, and the setup where SQLite stops being an option.