Skip to content

fix: raise local ClickHouse memory and concurrency limits#1905

Merged
tgmendes merged 1 commit intomainfrom
tiago/fix-local-clickhouse-memory-limits
Mar 31, 2026
Merged

fix: raise local ClickHouse memory and concurrency limits#1905
tgmendes merged 1 commit intomainfrom
tiago/fix-local-clickhouse-memory-limits

Conversation

@tgmendes
Copy link
Copy Markdown
Contributor

@tgmendes tgmendes commented Mar 17, 2026

Summary

I found that when testing our telemetry logs locally some tool call logs were not showing up. I believe this to be a resource issue due to the generation of materliazed clickhouse views. After I changed these params the logs were working as expected.

  • Raises local ClickHouse memory and concurrency limits that were causing telemetry inserts to be silently dropped
  • The JSON column type used by telemetry_logs is memory-intensive, and concurrent inserts triggering materialized views would exceed the 1 GB server memory cap — ClickHouse silently discards data while returning success to the client

Changes

Setting Before After File
max_server_memory_usage 1 GB 0 (auto, 90% of container RAM) config.d/limits.xml
max_memory_usage (per query) 512 MB 0 (bounded by server cap) users.d/dev_profile.xml
max_memory_usage_for_user 1 GB 0 (bounded by server cap) users.d/dev_profile.xml
max_concurrent_queries_for_user 2 30 users.d/dev_profile.xml
max_concurrent_queries_for_all_users 4 30 users.d/dev_profile.xml

After applying, rebuild the ClickHouse container: docker compose build clickhouse && docker compose up -d clickhouse


Open with Devin

The overly restrictive local dev limits (1 GB server memory, 512 MB per
query, 2 concurrent queries per user) caused telemetry inserts to be
silently dropped. The JSON column type used by telemetry_logs is
memory-intensive, and concurrent inserts that trigger materialized views
would exceed the memory ceiling — ClickHouse would silently discard the
data while returning success to the client.

- Set max_server_memory_usage to 0 (auto = 90% of container RAM)
- Set per-query and per-user memory limits to 0 (bounded by server cap)
- Raise concurrent query limits from 2/4 to 30/30
@tgmendes tgmendes requested a review from a team as a code owner March 17, 2026 14:16
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Mar 17, 2026 2:16pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 17, 2026

⚠️ No Changeset found

Latest commit: ea7662b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@tgmendes tgmendes merged commit 9a72a72 into main Mar 31, 2026
33 checks passed
@tgmendes tgmendes deleted the tiago/fix-local-clickhouse-memory-limits branch March 31, 2026 13:49
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants