mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
Two settings that decide whether a deployment survives load, neither of which appeared in any template. The connection pool. Left unset, Go's defaults apply, and MaxIdleConns is 2: under load almost every request opens a TCP connection and closes it again, local ports run out, and the process answers "can't assign requested address" to everything. Not slower - unavailable. A sweep against MySQL collapsed to zero successful responses at 64 concurrent requests without these, and served 13,846 req/s with no errors once they were set. The queue buffer. poolSize is the point at which messages start being dropped, not a tuning knob: a full queue discards the message and returns an error rather than blocking, and each stream has one consumer goroutine writing to the database. At the previous default of 100 a load test lost over 60% of them; at 1000, none. Login and operation logs travel this queue, so what gets lost is audit data - though only when logger.enableddb is on. Both carry the reasoning in the file, because the failure mode of each is invisible until it happens in production.