Blog

27 articles

Where does the time go? Profiling gocloak with pprof

CPU and heap profiles from gocloak benchmarks with go tool pprof: why encoding/json v1 reads its input twice, why resty's body limit causes two thirds of all allocated bytes, and how a too small connection pool shifts TLS handshake CPU onto the Keycloak side.

go pprof profiling performance

gocloak benchmarks, final numbers: five HTTP stacks, json/v2 and a cold JVM

The complete benchstat tables for gocloak against a fake and a real Keycloak: five HTTP stacks, connection pools, json/v2 over the whole request path, plus four benchmark traps: a cold JVM, a Docker port forwarder that one client poisoned for the next, Git Bash rewriting benchstat flags, and load changes between sequential runs. Plus what gocloak v15.1.0 on Go 1.27 changes.

go keycloak gocloak performance

How fast can gocloak talk to Keycloak? json/v2, fasthttp and the connection pool

Benchmarking gocloak against Keycloak 26: encoding/json/v2 decodes Keycloak payloads 26 to 74 % faster with no code change but encodes small structs more slowly, fasthttp wins micro-benchmarks but barely matters against a real Keycloak, and resty's default connection pool is the real bottleneck under parallel load. Go 1.27 makes json/v2 the default, and gocloak v15.1.0 fixes the pool.

go keycloak gocloak performance

gocloak-auth-proxy: a fast, Keycloak-native auth proxy in Go

gocloak-auth-proxy verifies Keycloak JWTs locally for Traefik and nginx forward-auth, as a reverse proxy or with OIDC browser SSO. Benchmarks against oauth2-proxy, gogatekeeper and reference proxies in Rust, Java and Python, the security model and a setup guide.

go keycloak gocloak oidc