Conversation
…ention The clickhouse container ran with the Docker default nofile of 4096. Background merges over the unbounded trace_log open thousands of sparse subcolumn files at once, hit errno 24, and the failing merge is hot-retried ~2.75x/s forever — pinning executor threads at 100% CPU and breaking trace-detail queries with HTTP 500. - ulimits nofile 262144/262144 on the clickhouse service, mirroring docker-compose-observability.yml (rootless-safe) - system-logs.xml in config.d: TTL 3d for trace_log/text_log, 7d for metric/query/part/processors_profile/asynchronous logs, logger level warning to stop the debug flood
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the "Too many open files" (errno 24) degradation of the bundled
langfuse-clickhousecontainer described in #402: under sustained trace ingestion, background merges over the unboundedsystem.trace_logexhaust the Docker defaultnofile=4096, the failing merge is hot-retried forever at ~100% CPU per executor thread, and trace-detail queries return HTTP 500.Changes
docker-compose-langfuse.yml—ulimits: nofile 262144/262144on the clickhouse service. This is the root-cause fix (ClickHouse docs recommend ≥262k). Mirrors whatdocker-compose-observability.ymlalready sets for its clickhouse; works in rootless Docker. Adds a bind mount for aconfig.doverride.langfuse/clickhouse/system-logs.xml(new) — bounded retention for system log tables: TTL 3 days fortrace_log/text_log, 7 days formetric_log/query_log/part_log/processors_profile_log/asynchronous_metric_log; logger levelwarningto stop the debug flood. Without TTLs the giant merges keep being re-scheduled even after the FD limit is raised.Validation
docker compose -f docker-compose-langfuse.yml configparses clean; YAML/XML validated.<name>_0(no TTL). The legacy_0tables need a one-shotALTER TABLE ... MODIFY TTLor the old data stays on disk — documented in the issue thread.Closes #402