Skip to main content
Tekton Pipelines performance can be tuned by adjusting controller parameters including thread count, API throttling, and resource limits.

Overview

Three primary parameters impact Tekton controller performance:
  • ThreadsPerController - Number of goroutines for processing the work queue
  • QPS (Queries Per Second) - Maximum queries to the Kubernetes API server
  • Burst - Maximum burst for API throttling

Default Values

Out-of-the-box configuration:
QPS and Burst values are multiplied by 2 internally, so the actual values are double the configured values.

Configuration Methods

Performance parameters can be configured using:
  1. Command-line flags in the controller deployment
  2. Environment variables
Command-line flags take precedence over environment variables.

Configuring via Command-Line Flags

Modify the controller deployment in config/controller.yaml:
Apply the changes:

Available Flags

integer
default:"2"
Number of threads (goroutines) to create per controller for processing the work queue.Higher values increase parallelism but consume more memory.
float
default:"5.0"
Maximum queries per second to the Kubernetes API server from this client.Note: Actual QPS is multiplied by 2 internally.
With this configuration, actual QPS = 100.
integer
default:"10"
Maximum burst for throttling API requests.Note: Actual burst is multiplied by 2 internally.
With this configuration, actual burst = 100.

Configuring via Environment Variables

Alternatively, use environment variables:
string
Environment variable for threads per controller.
string
Environment variable for API queries per second.
string
Environment variable for API burst throttling.

Performance Tuning Guidelines

Small Deployments (< 100 PipelineRuns/day)

Use default values:

Medium Deployments (100-1000 PipelineRuns/day)

Increase concurrency:

Large Deployments (> 1000 PipelineRuns/day)

Maximize throughput:

High-Concurrency Scenarios

For clusters with many simultaneous PipelineRuns:

Resource Requirements

Adjust controller resource limits based on performance configuration:

Resource Scaling Guidelines

Monitoring Performance

Key Metrics

Monitor these metrics to assess controller performance:

Performance Indicators

Good Performance:
  • Work queue depth remains low (< 10)
  • Reconciliation latency < 1s (p95)
  • API client latency < 100ms (p95)
  • No throttling errors in logs
Poor Performance:
  • Work queue depth grows unbounded
  • Reconciliation latency > 5s (p95)
  • API client latency > 500ms (p95)
  • Frequent “rate limit exceeded” errors

Troubleshooting

High Work Queue Depth

Symptoms: Work queue depth metric increases continuously Solutions:
  1. Increase threads-per-controller
  2. Verify API server health
  3. Check for slow reconciliation (enable debug logging)

API Rate Limiting

Symptoms: Logs show “rate limit exceeded” or “client rate limiter Wait” Solutions:
  1. Increase kube-api-qps and kube-api-burst
  2. Verify API server capacity
  3. Consider cluster API server scaling

High Memory Usage

Symptoms: Controller pods are OOMKilled or approaching memory limits Solutions:
  1. Increase memory limits
  2. Reduce threads-per-controller if excessively high
  3. Check for memory leaks (file issue if found)

Slow Reconciliation

Symptoms: PipelineRuns take long to start or complete Solutions:
  1. Enable debug logging to identify bottlenecks
  2. Increase threads-per-controller
  3. Verify webhook performance
  4. Check node and pod resource availability

Complete High-Performance Configuration

Best Practices

  1. Start with defaults and increase gradually based on metrics
  2. Match thread count to workload - Don’t over-provision
  3. Monitor API server impact when increasing QPS/Burst
  4. Adjust resource limits proportionally with thread count
  5. Enable HA for production deployments (3+ replicas)
  6. Use HPA for webhook to handle variable load
  7. Test changes in non-production environment first
  8. Monitor continuously after configuration changes
  9. Document tuning decisions for future reference
  10. Review quarterly and adjust based on workload changes