netflix/concurrency-limits

Concurrency Limits is a Java library that implements adaptive concurrency control by applying TCP congestion control concepts to automatically detect...

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 39 minutes ago
Added to GitGenius on September 19th, 2026
Created on December 11th, 2017
Open Issues & Pull Requests: 53 (+0)
GitHub issues: Enabled
Number of forks: 326
Total Stargazers: 3,615 (+0)
Total Subscribers: 364 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 5.3 hours
Mean response time: 440.5 days
90th percentile: 1759.6 days
Tracked items: 4

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 7
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 725 days
Stale 30+ days: 7
Stale 90+ days: 7

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Concurrency Limits is a Java library that implements adaptive concurrency control by applying TCP congestion control concepts to automatically detect optimal request limits for services.

The library addresses the problem that traditional rate-limiting based on requests per second becomes outdated in auto-scaling distributed systems and fails to gracefully shed load. Instead of thinking in terms of RPS, the tool applies queuing theory to determine how many concurrent requests a service can handle before queues build up and latency increases. It estimates concurrency limits at each point in the network by measuring latency to detect when queuing occurs and using timeouts or rejected requests to back off aggressively. The approach treats a system's concurrency limit like a TCP congestion window, allowing each node to adjust its local limit as the system scales. The library provides multiple limit algorithms: Vegas, a delay-based algorithm that increases the limit by one per sampling window if estimated queue depth stays below a threshold and decreases it if the queue exceeds a higher threshold, and Gradient2, which tracks divergence between long and short-term exponential latency averages to smooth out outliers and identify queueing trends for aggressive limit reduction.

The tool suits teams operating large distributed systems where RPS limits become stale quickly due to auto-scaling, and where graceful load shedding matters more than absolute throughput. It works best when services have measurable latency characteristics and when operators want to avoid the complexity of manually determining hardware-specific concurrency limits. The library provides enforcement strategies including a simple gauge-based approach that rejects requests once inflight count reaches the limit, and a percentage-based strategy for more nuanced request handling.

The project shows sustained development activity with regular commits addressing both new features and maintenance. The codebase receives updates that refine the limit algorithms and expand enforcement options. Pull requests indicate ongoing refinement of the core congestion control logic and integration patterns. The project maintains documentation of its algorithms and design rationale, suggesting attention to helping operators understand the approach rather than treating it as a black box.