SurfSense/surfsense_backend/app
Claude 7f1476799c
Optimize RAM usage with lazy loading and memory limits
Major RAM savings (1.5-3GB reduction at startup):
- Implement lazy loading for embedding model, chunker, and reranker
- Models now load on first use instead of at startup
- Reduce embedding batch_size from 128 to 32 (saves 100-200MB spikes)

Celery memory optimizations:
- Reduce result_expires from 24h to 1h (saves Redis RAM)
- Reduce worker_max_tasks_per_child from 1000 to 100
- Add worker_max_memory_per_child=256MB limit to prevent leaks

Before: ~2-4GB RAM at startup
After: ~500MB-1GB at startup, models load on demand
2025-11-18 23:13:29 +00:00
..
agents Parallelize connector searches for 40-60% latency improvement 2025-11-18 23:00:02 +00:00
config Optimize RAM usage with lazy loading and memory limits 2025-11-18 23:13:29 +00:00
connectors chore: linting 2025-11-03 16:00:58 -08:00
prompts Fixed all ruff lint and formatting errors 2025-07-24 14:43:48 -07:00
retriver recurse fix 2025-08-20 10:21:59 -07:00
routes Improve code quality per PR #11 and #12 review feedback 2025-11-18 22:46:17 +00:00
schemas Add disable_registration toggle to site configuration 2025-11-18 14:28:16 +02:00
services Update streaming service and database connection handling 2025-11-17 20:34:56 +02:00
tasks Update streaming service and database connection handling 2025-11-17 20:34:56 +02:00
utils feat: Implement local-first European AI architecture with Mistral NeMo and TildeOpen 2025-11-17 19:58:20 +02:00
__init__.py feat: SurfSense v0.0.6 init 2025-03-14 18:53:14 -07:00
app.py Refactor auth token usage to use AUTH_TOKEN_KEY constant 2025-11-18 22:03:56 +00:00
celery_app.py Optimize RAM usage with lazy loading and memory limits 2025-11-18 23:13:29 +00:00
db.py Add disable_registration toggle to site configuration 2025-11-18 14:28:16 +02:00
users.py Update streaming service and database connection handling 2025-11-17 20:34:56 +02:00