DocumentationNeurondB Documentation

Configure NeurondB for Production Workloads

Before you begin

Ensure you have:

  • NeurondB extension installed and listed in shared_preload_libraries
  • PostgreSQL superuser access for ALTER SYSTEM and configuration reloads
  • Baseline metrics for vector workload (QPS, recall targets, latency SLO)
  • Optional: GPU drivers (CUDA or ROCm) installed if enabling GPU mode

Core configuration (postgresql.conf)

Add the baseline NeurondB checks to your cluster configuration. Adjust vector index tuning, inference options, and background workers.

Baseline parameters

postgresql.conf

# Load extension
shared_preload_libraries = 'neurondb'

# Vector index tuning
neurondb.ef_search = 40           -- Search accuracy (10-200)
neurondb.m = 16                   -- HNSW connections per node (4-48)
neurondb.ef_construction = 200    -- Build quality (10-500)

# Embedding inference & caching
neurondb.model_path = '/var/lib/neurondb/models'
neurondb.inference_threads = 4
neurondb.batch_inference_size = 32
neurondb.cache_size_mb = 256

# Background workers
neurondb.neuranq_enabled = on
neurondb.neuranq_naptime = 1000
neurondb.neuranmon_enabled = on  
neurondb.neuranmon_naptime = 60000
neurondb.neurandefrag_enabled = on
neurondb.neurandefrag_naptime = 300000

# Performance toggles
neurondb.enable_prefetch = on
neurondb.enable_simd = on

GPU acceleration (optional)

Enable GPU kernels for distance computations and embedding inference. Define memory pools and fallback behaviour.

CUDA / ROCm settings

GPU parameters

# GPU configuration
neurondb.gpu_enabled = off
neurondb.gpu_backend = 'cuda'         -- or 'rocm'
neurondb.gpu_device = 0               -- GPU device ordinal
neurondb.gpu_batch_size = 8192
neurondb.gpu_streams = 2
neurondb.gpu_memory_pool_mb = 512
neurondb.gpu_fail_open = on           -- Fallback to CPU
neurondb.gpu_kernels = 'l2,cosine,ip'

Validate GPU runtime

Runtime validation

-- Confirm GPU kernels are registered
SELECT *
FROM   neurondb_gpu_capabilities();

-- Force GPU usage for this session
SET neurondb.gpu_enabled = on;
SET neurondb.gpu_backend = 'cuda';

Runtime overrides (session-level)

Adjust accuracy, caching, and inference behaviour without restarting PostgreSQL. Ideal for A/B tests and workload experiments.

Session tuning commands

Session overrides

-- Improve recall for analytics session
SET neurondb.ef_search = 120;

-- Enable GPU acceleration in this session only
SET neurondb.gpu_enabled = on;

-- Increase vector cache size temporarily
SET neurondb.cache_size_mb = 512;

-- Inspect active configuration
SELECT * FROM neurondb_config();

Performance profiles

Apply recommended parameter combinations for specific workload goals. Use ALTER SYSTEM and reload to persist cluster-wide.

Low latency workloads

Latency-optimised

ALTER SYSTEM SET neurondb.ef_search = 20;
ALTER SYSTEM SET neurondb.enable_prefetch = on;
ALTER SYSTEM SET neurondb.enable_simd = on;
ALTER SYSTEM SET neurondb.gpu_enabled = on;

High accuracy workloads

Recall-optimised

ALTER SYSTEM SET neurondb.ef_search = 200;
ALTER SYSTEM SET neurondb.ef_construction = 500;
ALTER SYSTEM SET neurondb.m = 32;
ALTER SYSTEM SET neurondb.batch_inference_size = 16;

Large-scale deployments

High throughput

ALTER SYSTEM SET neurondb.cache_size_mb = 1024;
ALTER SYSTEM SET neurondb.inference_threads = 8;
ALTER SYSTEM SET neurondb.neuranq_batch_size = 200;
ALTER SYSTEM SET neurondb.enable_prefetch = on;

Next Steps