Configuration¶
Grafeo can be configured for different use cases, from small embedded applications to high-performance server deployments.
Database Modes¶
In-Memory Mode¶
For temporary data or maximum performance:
Data Persistence
In-memory databases do not persist data. All data is lost when the database is closed.
Persistent Mode¶
For durable storage:
Configuration Options¶
Memory Limit¶
Control the maximum memory usage:
Thread Pool Size¶
Configure parallelism:
Default Thread Count
By default, Grafeo uses the number of available CPU cores.
Configuration Reference¶
| Option | Type | Default | Description |
|---|---|---|---|
path | string | None | Database file path (None for in-memory) |
memory_limit | int | System RAM | Maximum memory usage in bytes |
threads | int | CPU cores | Number of worker threads |
read_only | bool | false | Open database in read-only mode |
Environment Variables¶
Grafeo can also be configured via environment variables:
| Variable | Description |
|---|---|
GRAPHOS_MEMORY_LIMIT | Maximum memory in bytes |
GRAPHOS_THREADS | Number of worker threads |
GRAPHOS_LOG_LEVEL | Logging level (error, warn, info, debug, trace) |
Performance Tuning¶
For High-Throughput Workloads¶
db = grafeo.Database(
path="high_throughput.db",
memory_limit=8 * 1024 * 1024 * 1024, # 8 GB
threads=16
)
For Low-Memory Environments¶
For Read-Heavy Workloads¶
# Multiple read replicas can be opened read-only
db = grafeo.Database(
path="replica.db",
read_only=True
)
Next Steps¶
- User Guide - Learn more about using Grafeo
- Architecture - Understand how Grafeo works