Describe your questionHi Team, image: docker.io/langfuse/langfuse-worker:3.200.0
Note: As suggested by your team i have added below 2 but still getting traces timeout issue
2.Run OPTIMIZE TABLE traces FINAL and OPTIMIZE TABLE scores FINAL in ClickHouse to force part merges, which reduces deduplication overhead during queries Thanks & Regards, Langfuse Cloud or Self-Hosted?Langfuse Cloud If Self-Hosted3.200.0 If Langfuse CloudNo response SDK and integration versionsNo response Pre-Submission Checklist
|
Replies: 4 comments
|
The timeout issues you're experiencing with traces and prompts are likely related to insufficient ClickHouse resources or query performance. Here are several recommendations: Infrastructure SizingThe minimum recommended ClickHouse configuration is 2 CPU, 8 GiB Memory. (1) For larger deployments with slow UI queries, ClickHouse should have at least 16 GiB of memory as it's designed to scale vertically. (1) Performance Optimizations1. Add time filters to your queries Tracing data is indexed by projectId and time, so adding filter conditions on those fields should significantly improve performance. (1) 2. If using OpenTelemetry exclusively, enable FINAL modifier optimization Set 3. Consider routing reads to separate ClickHouse compute If using ClickHouse Cloud or BYOC, set ClickHouse System TablesClickHouse system log tables ( <clickhouse>
<trace_log remove="1"/>
<text_log remove="1"/>
<opentelemetry_span_log remove="1"/>
<asynchronous_metric_log remove="1"/>
<metric_log remove="1"/>
<latency_log remove="1"/>
</clickhouse>Check Largest TablesRun this query to identify which tables are consuming the most resources: 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
)Data RetentionConsider configuring a data retention policy to automatically remove old data, which is the most effective way to free disk space and improve query performance. (1) 📚 Sources: Have another question? Just tag @inkeep. |
|
we are using linux VM with data disc 350 GB, at present still the disc size 210 GB available in VM logs the the query is processing in sec and in code the read timeout we chnaged to 30 sec so from 2 days we not observing this issue, but what is the trace is processiong more than 30 sec again we will get timeout error what best you will suggest , anything needs to upgrade the versions? because after migrating to these versions only we are facing timeout issue before that it was working fine, 1 month back we updated these version. Thanks |
|
Hi @s, Thank you for your suggestion. We performed additional troubleshooting after your recommendation. Current Environment Initially, our SDK was configured with a 5-second read timeout and we observed: Failed to export span batch We then increased the SDK read timeout to 30 seconds. However, the issue still persists and now fails after approximately 30 seconds: Failed to export span batch This indicates that increasing the client timeout does not resolve the problem. UI behaviour Multiple users across DEV and QA environments intermittently observe: Request Timed Out The affected API paths include: traces.filterOptions Sometimes the request succeeds after refreshing the page, while other times it times out. ClickHouse observations We also checked ClickHouse. system.query_log shows normal SELECT queries completing in milliseconds during normal operation. You suggested using a larger ClickHouse cluster. Could you please clarify what indicators make you think the ClickHouse cluster is undersized? Are there any specific ClickHouse metrics you recommend checking (CPU, memory, active parts, merges, background pools, disk I/O, etc.) to confirm whether this is a resource bottleneck? Also, based on the behaviour above, do you think this issue can be resolved while staying on Langfuse v3, or would you recommend upgrading to a newer v3 release or directly to v4? Thank you for your guidance. |
|
Hi @vani760, you've been creating quite a few GitHub issues over the last few days. We'd like to better understand your use case and process, so could you please contact us at support@langfuse.com with the subject line "Vani760 - GitHub Issues"? Thanks! |


Hi @s,
Thank you for your suggestion.
We performed additional troubleshooting after your recommendation.
Current Environment
Langfuse Web: 3.200.0
Langfuse Worker: 3.200.0
ClickHouse: 26.6.1.1193
PostgreSQL: 17.9-bookworm
Redis: 7.4-bookworm
MinIO: latest
Deployment: Docker Compose on Azure VM
Changes already tested
Enabled:
CLICKHOUSE_DISABLE_LAZY_MATERIALIZATION=true
Executed:
OPTIMIZE TABLE traces FINAL;
OPTIMIZE TABLE scores FINAL;
Restarted the Langfuse web and worker containers.
Additional testing
Initially, our SDK was configured with a 5-second read timeout and we observed:
Failed to export span batch
HTTPSConnectionPool(...): Read timed out (read timeout=4.999...)
We then increas…