Slow loading on UI + Clickhouse Timeout Errors #10877
Replies: 7 comments 9 replies
|
The slow UI queries and ClickHouse timeout errors you're experiencing are likely related to query optimization and ClickHouse configuration rather than resource saturation(1). Key Issues and Solutions1. Query OptimizationThe error message "Database resource limit exceeded. Please use more specific filters or a shorter time range" indicates that your queries are too broad(1). When tracing data is queried, it's indexed by 2. ClickHouse Memory ConfigurationYour ClickHouse instance has 120 GiB memory, which should be sufficient, but you may need to verify the configuration. ClickHouse is designed to scale vertically—adding more memory to the instance should yield faster response times(1). The documentation recommends at least 16 GiB of memory for larger deployments(1). 3. ClickHouse Version IssueBased on a recent GitHub issue, there's a known bug in ClickHouse version 24.3.2.23 that causes similar timeout and query parameter errors(2). The issue was resolved by upgrading ClickHouse from 24.3.2.23 to 24.8.5.115(2). Langfuse supports ClickHouse versions >= 24.3(3). 4. EFS Performance ConsiderationsYou're using EFS (elastic mode) volumes with ClickHouse. For better performance, consider using blob storage (S3) as the primary disk for ClickHouse, as it's optimized for auto-scaling storage and increases availability and durability(3). Recommended Actions
The "Broken pipe" errors in ClickHouse logs suggest that connections are timing out before queries complete, which aligns with the query optimization issue mentioned above(1). 📚 Sources:
Have another question? Just tag @inkeep. |
|
Based on your clarifications, here are additional areas to investigate: 1. ClickHouse Cluster ConfigurationSince you're running ClickHouse on ECS Fargate, verify your 2. Query-Specific Performance IssuesThe "broken pipe" errors suggest queries are timing out before completion(2). A similar case in the GitHub discussions showed that even with adequate resources, queries were taking 10-15 seconds due to inefficient query patterns(3). The user found that queries filtering on The ClickHouse table structure uses this primary key ordering(3): This means filtering by 3. Network and Connection SettingsThe "Broken pipe" errors in your ClickHouse logs suggest network-level connection issues(3). Consider:
4. Disk I/O PerformanceWhile you clarified that S3 is your default disk, a similar discussion noted that EFS performance modes matter significantly(3). Even with elastic mode, throughput and IOPS limits can bottleneck ClickHouse operations(3). The discussion showed that switching from EFS bursting mode to elastic or provisioned mode improved latency from 150-300ms to 10-50ms(3). 5. Data Volume and PartitioningThe GitHub discussion showed that performance degraded exponentially after just a few thousand traces(3). With ClickHouse partitioned by 6. ClickHouse System Resource LimitsCheck if ClickHouse itself has internal resource limits that are being hit. You can query ClickHouse to identify slow queries(3): SELECT table, formatReadableSize(size) as size, rows FROM (
SELECT
table,
database,
sum(bytes) AS size,
sum(rows) AS rows
FROM system.parts
WHERE active
GROUP BY table, database
ORDER BY size DESC
)This helps identify if specific tables are growing too large(2). Given your configuration is already quite robust (16 CPUs, 120 GiB for ClickHouse), the issue is most likely query-pattern related or network connectivity between services rather than raw resource capacity. ** 📚 Sources:
Have another question? Just tag @inkeep. |
|
Hey langfuse team, can anyone help me with some guidance on this? I am parallelly trying to separate the ingestion and web workload as mentioned in your scaling docsbetween 2 separate containers not sure if it will solve this problem though |
|
@Steffen911 Some more context on this Will separating ingestion and web into 2 containers solve this problem? Or does this have to be solved at clickhouse level in terms of query optimization? |
|
@Steffen911 this was the output I received Also in the environment where I simulated this issue, I increased the load of ingestion and now the UI becomes completely unresponsive. It just keeps loading indefinitely. Web and worker give timeout errors The cpu utilization for clickhouse ecs fargate has jumped to 46% now. Web and worker dont show any spikes Could you please suggest the way forward now?
|



Uh oh!
There was an error while loading. Please reload this page.
Describe your question
I have self hosted langfuse on AWS and I frequently see slower loading times and backend service overloaded errors on UI
However resource saturation does not seem to be the issue
My current configuration is:
Langfuse web( 8cpus, 16gib memory)- ECS/fargate
Langfuse worker(8 cpus, 16gib memory)- ECS/fargate
Clickhouse(16cpus, 120gib memory)- ECS/fargate with EFS(elastic mode) volumes and uses S3 buckets as default disk
Whenever I see slower loading times on UI, cpu memory metrics are very underutilized but I can see thes elogs on langfuse web and clickhouse
Langfuse web logs
Clickhouse logs
I even set the KEEP_ALIVE_TIMEOUT for langfuse web and worker container higher than the ALB idle timeout. Still facing the same issue.
Is the issue related to query optimization? Or can we make some configuration changes in our self hosting environment to fix this?
Langfuse Cloud or Self-Hosted?
Self-Hosted
If Self-Hosted
3.116.1
If Langfuse Cloud
No response
SDK and integration versions
No response
Pre-Submission Checklist
All reactions