Node.js/Python/Go Runtime Tuning (Event Loop/GIL/Goroutines)
Runtime-specific performance: event-loop blocking, GC, worker pools, and profiling tools.
Diagnose performance for the {{Node.js / Python asyncio+uvicorn / Go}} service: {{symptom: latency spikes / CPU saturation / memory growth}}. Guide me with runtime-specific method: - Node: event-loop lag and GC pauses; use clinic.js/0x/--prof; identify sync crypto, JSON.parse of huge payloads, regex backtracking; worker_threads vs child_process for CPU; libuv threadpool defaults for fs/dns; promise cancellation/abort; stream backpressure; undici keepalive. - Python: GIL effects, sync calls blocking the loop, thread vs process pools, asyncpg/httpx connection limits, uvloop, allocation-driven GC, py-spy/ memray/tracemalloc, fork vs spawn, pandas memory. - Go: goroutine leaks (blocked channels), mutex contention pprof, GC GOGC, allocation profiling, prepooling buffers, connection pooling, scheduler latency, pprof cpu/mem/block/mutex profiles. Output: hypotheses ranked, exact profiling commands and what patterns prove them, fixes with code, load verification, and dashboard metrics (event-loop lag p99, GC pause, goroutine count, RSS) plus alerts. ================================================================================
自动翻译
自动翻译中…