Performance Troubleshooting
Diagnose and resolve performance issues in platform workflows.
Overview
Common performance issues:
-
Slow workflow execution
-
High memory usage
-
CPU bottlenecks
-
Database contention
Measuring Performance
Common Bottlenecks
1. Database Performance
Symptoms: * Long read/write times * High database CPU
Solutions:
-
Add indexes:
CREATE INDEX idx_customer_id ON orders(customer_id);
-
Optimize queries:
-
Use selective WHERE clauses
-
Avoid full table scans
-
-
Tune database:
-
Increase shared_buffers (PostgreSQL)
-
Adjust innodb_buffer_pool_size (MySQL)
-
2. Memory Issues
Symptoms: * OutOfMemoryError * GC pauses * Slow processing
Solutions:
-
Increase JVM heap:
export JAVA_OPTS="-Xmx8g -Xms4g"
-
Reduce batch size:
default_config: batch_size: 5000 # Lower from 10000
-
Process fewer tables concurrently:
default_config: parallel_tables: 2 # Lower from 4
3. Network Latency
Symptoms: * High time in data reading/writing * Low CPU usage
Solutions:
-
Use same network/region for the platform and databases
-
Enable compression:
url: jdbc:postgresql://host:5432/db?ssl=true&compression=true
-
Increase connection pool:
spring.datasource.hikari.maximum-pool-size=20
Optimization Techniques
Horizontal Scaling
Add more agents:
# docker-compose.yml
services:
agent:
replicas: 4 # Process 4 tables in parallel
See: Scaling Guide