From 100d2c392fe6cc66ffd09452beed5b55b5758065 Mon Sep 17 00:00:00 2001 From: yusing Date: Wed, 30 Apr 2025 18:30:46 +0800 Subject: [PATCH] chore: memory optimization for access log --- internal/logging/accesslog/access_logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/logging/accesslog/access_logger.go b/internal/logging/accesslog/access_logger.go index d6ec4a7..4f3ba46 100644 --- a/internal/logging/accesslog/access_logger.go +++ b/internal/logging/accesslog/access_logger.go @@ -125,7 +125,7 @@ func NewAccessLoggerWithIO(parent task.Parent, writer WriterWithName, anyCfg Any task: parent.Subtask("accesslog."+writer.Name(), true), cfg: cfg, writer: bufio.NewWriterSize(writer, cfg.BufferSize), - lineBufPool: synk.NewBytesPool(512, 8192), + lineBufPool: synk.NewBytesPool(256, 768), // for common/combined usually < 256B; for json < 512B errRateLimiter: rate.NewLimiter(rate.Every(errRateLimit), errBurst), logger: logging.With().Str("file", writer.Name()).Logger(), }