Logging
- Implement Python logging in UDFs and application endpoints
- Track execution time, errors, API call latency
- Use structured logging (JSON) for log aggregation
Resource Monitoring
- Monitor CPU, RAM, Disk I/O, Network on Pixeltable host
- Track UDF execution time and model inference latency
- Alert on resource exhaustion
| Metric | What to Watch |
|---|---|
| CPU | Sustained high usage during inference |
| Memory | Growth over time (potential leaks) |
| Disk I/O | Bottlenecks during media processing |
| Network | API call latency to external services |
Optimization
Batch Operations
Use batch processing for better throughput:Performance Tips
- Batch Operations: Use
@pxt.udf(batch_size=32)for GPU model inference - Batch Inserts: Insert multiple rows at once:
table.insert([row1, row2, ...]) - Profile UDFs: Add execution time logging to identify bottlenecks
- Embedding Indexes: Use pgvector for efficient similarity search
Rate Limiting
Built-In Provider Limits
Automatic rate limiting for OpenAI, Anthropic, Gemini, etc. is configured per-model inconfig.toml:
Custom API Rate Limiting
Useresource_pool to throttle calls to self-hosted models or custom endpoints:
Advanced Features
LLM & Agent Workflows
Build complex agent workflows as computed columns with tool calling, MCP integration, and persistent state.
Snapshots
Create immutable point-in-time copies for reproducible ML experiments.
Label Studio Integration
Sync tables with annotation projects for human-in-the-loop workflows.