Memory Usage
High memory consumption by backend services
High memory consumption by backend services
Problem: Backend processes consuming excessive RAM (>4GB).Solution:
-
Monitor memory usage:
-
Enable context summarization:
-
Reduce memory injection:
-
Limit concurrent subagents:
-
Configure thread pool sizes:
-
Use lightweight models for non-critical tasks:
Memory leak in long-running sessions
Memory leak in long-running sessions
Problem: Memory usage grows continuously over multiple conversations.Solution:
-
Clear conversation history periodically:
-
Enable aggressive summarization:
-
Clean up old threads:
-
Restart services periodically:
-
Monitor and set memory limits (Docker):
Out of memory errors in sandbox containers
Out of memory errors in sandbox containers
Problem:
OOMKilled or memory errors in sandbox containers.Solution:-
Increase Docker memory limit:
-
Configure container resource limits:
-
For Kubernetes provisioner mode:
-
Clean up sandbox artifacts:
-
Limit file sizes in sandbox:
Context Window Optimization
Context length exceeded errors
Context length exceeded errors
Problem:
Context length exceeded or Maximum token limit errors.Solution:-
Enable summarization (most important):
-
Use models with larger context windows:
-
Reduce memory injection tokens:
-
Limit skill injection:
-
Optimize tool descriptions:
-
Use subagents for isolated context:
Slow response times due to large context
Slow response times due to large context
Problem: Model takes >30 seconds to respond as conversation grows.Solution:
-
Aggressive summarization:
-
Start new thread for new topics:
-
Offload data to files:
-
Disable thinking mode for simple queries:
Sandbox Performance
Slow container startup times
Slow container startup times
Problem: Sandbox container takes >10 seconds to start.Solution:
-
Pre-pull sandbox image (most important):
-
Use Apple Container on macOS (faster than Docker):
-
Keep existing sandbox instead of recreating:
-
Optimize Docker storage driver:
-
Use local sandbox for development:
Slow file operations in sandbox
Slow file operations in sandbox
Problem: Reading/writing files in sandbox is sluggish.Solution:
-
Check mount type (macOS):
-
Reduce file I/O:
-
Use smaller files:
-
For Kubernetes provisioner - use local paths:
-
Optimize Docker Desktop settings (macOS):
Bash commands execute slowly in sandbox
Bash commands execute slowly in sandbox
Problem: Shell commands take longer than expected in sandbox.Solution:
-
Increase container CPU allocation:
-
Use local sandbox for CPU-intensive tasks:
-
Optimize commands:
-
Use bash agent for complex command sequences:
Scaling Considerations
Multiple concurrent users or threads
Multiple concurrent users or threads
Problem: Performance degrades with multiple simultaneous conversations.Solution:
-
Use provisioner mode with Kubernetes:
-
Configure resource limits per thread:
-
Implement request queuing (advanced):
-
Use multiple model providers:
-
Horizontal scaling (advanced):
Database/storage bottlenecks (memory.json, threads)
Database/storage bottlenecks (memory.json, threads)
Problem: Slow memory updates or thread data access.Solution:
-
Increase memory debounce time:
-
Use SSD for thread storage:
-
Clean up old threads regularly:
-
Limit fact storage:
-
Use external database (advanced):
Network latency to LLM providers
Network latency to LLM providers
Problem: Slow responses due to network issues.Solution:
-
Use geographically closer endpoints:
-
Increase timeout for slow connections:
-
Use local models (Ollama, LM Studio):
-
Implement caching (advanced):
-
Monitor provider status:
Performance Monitoring
How to monitor and profile DeerFlow performance
How to monitor and profile DeerFlow performance
Solution:
-
Enable detailed logging:
-
Monitor resource usage:
-
Track API response times:
-
Profile Python code (advanced):
-
Use LangSmith for LLM tracing (advanced):
-
Benchmark specific operations:
Next Steps
- Common Issues - General troubleshooting
- Sandbox Errors - Container-specific issues
- Configuration Guide - Optimize your configuration
- Architecture - Understand system design for better optimization