From 65635ef9bcb7b0471cc045ec25cec0c1cfcc885f Mon Sep 17 00:00:00 2001 From: Alok Nerurkar Date: Fri, 19 Sep 2025 01:11:38 +0530 Subject: [PATCH 1/3] fix: increase pg connection strength --- cl/singlenode/payloadstore/postgres.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl/singlenode/payloadstore/postgres.go b/cl/singlenode/payloadstore/postgres.go index f2cbab334..949e040a4 100644 --- a/cl/singlenode/payloadstore/postgres.go +++ b/cl/singlenode/payloadstore/postgres.go @@ -27,9 +27,9 @@ func NewPostgresRepository(ctx context.Context, dsn string, logger *slog.Logger) return nil, fmt.Errorf("failed to open postgres connection: %w", err) } - db.SetMaxOpenConns(25) - db.SetMaxIdleConns(25) - db.SetConnMaxLifetime(5 * time.Minute) + db.SetMaxOpenConns(100) + db.SetMaxIdleConns(50) + db.SetConnMaxLifetime(1 * time.Hour) pingCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() From 5774b6bd8d72a7a20a12e94d4a050f162991ce0d Mon Sep 17 00:00:00 2001 From: Alok Nerurkar Date: Fri, 19 Sep 2025 01:24:59 +0530 Subject: [PATCH 2/3] fix: increase pg connection strength --- cl/singlenode/payloadstore/postgres.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cl/singlenode/payloadstore/postgres.go b/cl/singlenode/payloadstore/postgres.go index 949e040a4..6e3e31ce8 100644 --- a/cl/singlenode/payloadstore/postgres.go +++ b/cl/singlenode/payloadstore/postgres.go @@ -110,6 +110,7 @@ func (r *PostgresRepository) SavePayload(ctx context.Context, info *types.Payloa "Failed to insert payload into postgres", "payload_id", info.PayloadID, "block_height", info.BlockHeight, + "dbStats", r.db.Stats(), "error", err, ) return fmt.Errorf("failed to insert payload into postgres: %w", err) From 9a36dc9ed6a360d087a49ea05c978576fe9aed88 Mon Sep 17 00:00:00 2001 From: Alok Nerurkar Date: Fri, 19 Sep 2025 01:28:17 +0530 Subject: [PATCH 3/3] fix: test reduce strength --- cl/singlenode/payloadstore/postgres.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl/singlenode/payloadstore/postgres.go b/cl/singlenode/payloadstore/postgres.go index 6e3e31ce8..5a34968cf 100644 --- a/cl/singlenode/payloadstore/postgres.go +++ b/cl/singlenode/payloadstore/postgres.go @@ -27,9 +27,9 @@ func NewPostgresRepository(ctx context.Context, dsn string, logger *slog.Logger) return nil, fmt.Errorf("failed to open postgres connection: %w", err) } - db.SetMaxOpenConns(100) - db.SetMaxIdleConns(50) - db.SetConnMaxLifetime(1 * time.Hour) + db.SetMaxOpenConns(10) + db.SetMaxIdleConns(5) + db.SetConnMaxLifetime(5 * time.Minute) pingCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel()