This guide will help you quickly set up and use the Feed Processor's optimization features.
The optimization system is enabled by default. To use it with default settings, no additional configuration is needed:
from feed_processor.core.processor import FeedProcessor
processor = FeedProcessor(
inoreader_token="your_token",
webhook_url="your_webhook_url"
)If you need to customize the optimization behavior:
from feed_processor.config.processor_config import ProcessorConfig
config = ProcessorConfig(
# Adjust these based on your needs
batch_size=100, # Starting batch size
target_cpu_usage=70.0, # Target CPU utilization
concurrent_processors=4 # Starting thread count
)
processor = FeedProcessor(
inoreader_token="your_token",
webhook_url="your_webhook_url",
config=config
)- Open the Grafana dashboard at
http://your-server:3000 - Load the "Feed Processor Optimization" dashboard
- Monitor these key metrics:
- Processing batch size
- Thread count
- Processing rate
- Average processing time
config = ProcessorConfig(
batch_size=200,
max_batch_size=1000,
concurrent_processors=8,
target_cpu_usage=80.0
)config = ProcessorConfig(
batch_size=50,
max_batch_size=200,
concurrent_processors=2,
target_cpu_usage=50.0
)config = ProcessorConfig(
batch_size=100,
max_batch_size=500,
concurrent_processors=4,
target_cpu_usage=70.0
)If you encounter issues:
-
High CPU Usage
- Decrease
target_cpu_usage - Reduce
max_processors
- Decrease
-
Slow Processing
- Increase
min_batch_size - Increase
concurrent_processors
- Increase
-
High Memory Usage
- Decrease
max_batch_size - Reduce
concurrent_processors
- Decrease
- Check the full documentation in
docs/optimization/README.md - Review the monitoring dashboard
- Check the logs for optimization-related messages