1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Maproom Performance Configuration
# Generated by PERF_OPT-5002 tuning
#
# This configuration is optimized for:
# - 8-core CPU
# - 8GB RAM
# - SSD storage
# - PostgreSQL database
#
# For other hardware configurations, see docs/PERFORMANCE_TUNING.md
# Embedding configuration
embedding:
provider: "openai"
model_name: "text-embedding-3-small"
dimension: 1536
cache_size: 10000
cache_ttl_seconds: 3600
# Fusion configuration
fusion:
method: "rrf" # Options: rrf, weighted, learned
rrf_k: 60
weights:
fts: 0.3
vector: 0.3
graph: 0.2
recency: 0.1
churn: 0.1
# Performance configuration
performance:
max_candidates_per_method: 100
final_result_limit: 20
timeout_ms: 1000
parallel_execution: true
# Index configuration
index:
ivfflat_lists: 100
ivfflat_probes: 10
refresh_interval_seconds: 3600
# Feature flags
feature_flags:
enable_vector_search: true
enable_hybrid_fusion: true
enable_graph_signals: true
enable_temporal_signals: true
enable_query_cache: true
enable_hot_reload: false
# Cache configuration (PERF_OPT-4001, PERF_OPT-4002)
cache:
l1_query:
max_entries: 100
ttl_seconds: 3600 # 1 hour
enabled: true
l2_embedding:
max_entries: 1000
ttl_seconds: 86400 # 24 hours
enabled: true
l3_context:
max_entries: 500
ttl_seconds: 1800 # 30 minutes
enabled: true
parse_tree:
max_entries: 200
ttl_seconds: 0 # Never expire (until file changes)
enabled: true
# Indexing configuration (PERF_OPT-5002)
indexing:
parallel_workers: 8 # Tuned for 8-core CPU
batch_size: 50 # Optimal throughput/memory balance
max_file_size: 10485760 # 10MB limit
chunk_insert_batch_size: 100 # Database INSERT batch
edge_insert_batch_size: 500 # Edge INSERT batch
# Database configuration (PERF_OPT-5002)
database:
pool_size: 20 # Handles concurrent operations
connection_timeout_ms: 5000 # 5s to acquire connection
statement_timeout_ms: 5000 # 5s query timeout
lock_timeout_ms: 1000 # 1s lock wait
idle_in_transaction_timeout_ms: 30000 # 30s idle in transaction
work_mem: "256MB" # Per-operation memory
max_connection_lifetime_secs: 1800 # 30 minutes
idle_connection_timeout_secs: 600 # 10 minutes
# Runtime configuration (PERF_OPT-5002)
runtime:
worker_threads: 8 # Tokio workers (match CPU cores)
max_blocking_threads: 16 # For blocking operations
thread_stack_size: 2097152 # 2MB stack
enable_thread_names: true # Enable for debugging
# Buffer configuration (PERF_OPT-5002)
buffers:
file_read_buffer: 65536 # 64KB
db_buffer: 32768 # 32KB
parse_buffer: 1048576 # 1MB
buffer_pool_size: 100 # Maximum pooled buffers
# PostgreSQL configuration recommendations
# Add these settings to postgresql.conf:
#
# # Memory settings
# shared_buffers = '2GB' # 25% of system RAM
# effective_cache_size = '6GB' # 50% of system RAM
# work_mem = '256MB' # Per-operation memory
# maintenance_work_mem = '512MB' # For VACUUM, CREATE INDEX
#
# # Performance settings
# random_page_cost = 1.1 # SSD optimization
# effective_io_concurrency = 200 # Parallel I/O
# max_worker_processes = 8 # Background workers
# max_parallel_workers_per_gather = 4 # Parallel query workers
# max_parallel_workers = 8 # Total parallel workers
#
# # Connection settings
# max_connections = 100
#
# # Logging (for performance monitoring)
# log_min_duration_statement = 1000 # Log queries >1s
# log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
# log_checkpoints = on
# log_connections = on
# log_disconnections = on
# log_lock_waits = on
# log_temp_files = 0
#
# # Statistics
# track_activities = on
# track_counts = on
# track_io_timing = on
# track_functions = all
# stats_temp_directory = '/var/run/postgresql'