Skip to content

feat: make ClickHouse connection limit configurable - #4492

Open
arthurbragaa wants to merge 2 commits into
umami-software:devfrom
arthurbragaa:configurable-clickhouse-connection-limit
Open

arthurbragaa wants to merge 2 commits into
umami-software:devfrom
arthurbragaa:configurable-clickhouse-connection-limit

Conversation

@arthurbragaa

@arthurbragaa arthurbragaa commented Aug 26, 2026

Copy link
Copy Markdown

Summary

  • add optional CLICKHOUSE_MAX_OPEN_CONNECTIONS configuration
  • validate positive integers during database preflight
  • preserve the ClickHouse client default when unset
  • document the default and per-instance pool sizing

Closes #4491.

Verification

  • pnpm test — 95 files, 748 tests
  • pnpm exec tsc --noEmit
  • pnpm build
  • changed-file Biome lint
  • production Docker image build
  • Docker Compose integration: default peaked at 10 connections; configured 25 peaked at 25 with 50/50 successful /api/send requests; invalid 0 exited before health startup

Full pnpm lint remains blocked by pre-existing diagnostics on dev; the changed files pass Biome.

AI assistance disclosure: This contribution was implemented and tested with AI assistance and reviewed by Arthur Braga Alfredo.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Implemented and tested with AI assistance; reviewed by Arthur Braga.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@arthurbragaa is attempting to deploy a commit to the Umami Software Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes the ClickHouse client connection limit configurable while retaining the client default when unset.

  • Adds positive-integer validation for enabled ClickHouse deployments.
  • Skips this validation when ClickHouse is disabled or database preflight is explicitly skipped.
  • Adds focused client-option tests and deployment sizing documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/lib/clickhouse.ts Gates connection-limit parsing on ClickHouse being enabled and conditionally forwards the validated value to the client.
scripts/check-db.js Validates the optional limit only after the preflight skip and only for enabled ClickHouse deployments.
src/lib/clickhouse.test.ts Covers defaults, configured limits, invalid values, and disabled ClickHouse behavior.
README.md Documents the option, current client default, and per-instance pool sizing.

Reviews (2): Last reviewed commit: "fix: ignore ClickHouse limit when disabl..." | Re-trigger Greptile

Comment thread src/lib/clickhouse.ts Outdated
@mikecao

mikecao commented Sep 11, 2026

Copy link
Copy Markdown
Member

@greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants