ACE Documentation Index
ACE v0.1.0 - Adaptive Concurrency Engine
Getting Started (30 minutes)
- Install -
pip install ace-concurrency - Quick Start - Run async example
- Configuration - Customize AIMD parameters
- Observability - Monitor via JSON logs
Core Concepts
System Signals
Monitored every 2 seconds:
- CPU utilization (%)
- Memory utilization (%)
- Event loop lag (milliseconds)
- Queue depth (tasks waiting)
- Kafka consumer lag (optional)
Decision Types
- INCREASE: Proactive (low load) or reactive (queue catching up)
- DECREASE: High CPU/memory or queue overflow
- HOLD: Steady state, system healthy
Integration Guides
Async Tasks
Best for: I/O-bound work (API calls, database queries)
async with ACEAsyncioManager(config) as mgr:
await mgr.submit(your_async_task())
Thread Pools
Best for: CPU-bound work (calculations, data processing)
with ACEThreadPoolManager(config) as mgr:
mgr.submit(your_sync_function)
Kafka Consumers
Best for: Event streaming with backpressure
async with ACEKafkaConsumerManager(config, "topic") as mgr:
await mgr.process_async(handler)
Configuration Guide
Basic Configuration
config = AIMDConfig(
min_limit=1,
max_limit=100,
initial_limit=10,
)
Advanced Configuration
config = AIMDConfig(
# Concurrency bounds
min_limit=5,
max_limit=200,
initial_limit=50,
# AIMD parameters
increase_step=5, # More aggressive increase
decrease_factor=0.3, # Faster decrease
# Thresholds (CPU/Memory %)
cpu_threshold=75.0,
memory_threshold=80.0,
cpu_increase_threshold=30.0, # Earlier proactive scaling
memory_increase_threshold=40.0,
# Timing (seconds)
adjustment_interval=1, # More frequent decisions
cooldown_period=10, # Longer wait after decrease
)
Monitoring & Observability
Structured JSON Logs
{
"timestamp": "2026-01-16T14:30:45Z",
"level": "INFO",
"message": "AIMD decision",
"decision": "INCREASE",
"current_limit": 10,
"new_limit": 12,
"signals": {
"cpu_percent": 35.5,
"memory_percent": 42.3,
"queue_depth": 5,
"event_loop_lag_ms": 2.1
}
}
Metrics to Track
- Current concurrency limit
- Active task count
- CPU/Memory utilization
- Decision frequency (INCREASE/DECREASE/HOLD)
- System response time
Version Information
| Property | Value |
|---|---|
| Package | ace-concurrency |
| Version | 0.1.0 |
| Python | 3.8+ |
| License | MIT |
| Status | Production-Ready |
| PyPI | https://pypi.org/project/ace-concurrency/ |
Common Tasks
Task: Change concurrency limits
# During runtime (if you need dynamic adjustment)
with ACEAsyncioManager(config) as mgr:
# Limits controlled automatically by AIMD
# To override, set directly:
# Not recommended - trust AIMD algorithm
pass
Task: Access current limit
async with ACEAsyncioManager(config) as mgr:
print(f"Current limit: {mgr.current_limit}")
print(f"Active tasks: {mgr.active_tasks}")
Task: Custom signal collection
from ace.core.signals import SignalCollector
collector = SignalCollector()
collector.set_queue_depth(len(my_queue))
signals = await collector.collect_all_async()
Task: Batch multiple AIMD managers
# Multiple independent managers (recommended for isolation)
async with ACEAsyncioManager(config1) as mgr1:
async with ACEAsyncioManager(config2) as mgr2:
# Separate control loops
pass
Support Resources
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Code Examples: See
intergrations/directory
Metadata
Release files for ace-concurrency 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ace_concurrency-0.1.1.tar.gz | 12.6 kB | Without provenance | Details for ace_concurrency-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ace_concurrency-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for ace_concurrency-0.1.1-py3-none-any.whl |
Total release size: 27.0 kB
Release files / ace_concurrency-0.1.1.tar.gz
| Download URL | ace_concurrency-0.1.1.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0ad36381f94f0bf31c4081807afa11ff5881e4c6654d906f00430d3e7f9665c
|
|
BLAKE2b-256 checksum How to use checksums |
3eee4858a530e45e8e87f5bbdb8b38cfbbe931e4a8fc2c0acbf99705ce665386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ace_concurrency-0.1.1-py3-none-any.whl
| Download URL | ace_concurrency-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3285a78fa6526e831d2a9f1e2bc94b718cdfadedaa82cd7fc3b33c55553d247
|
|
BLAKE2b-256 checksum How to use checksums |
72bc42df9858ec6eb5a4a558c246d375eb2e024f6eae485f4afbe2fc01b303a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for ace-concurrency 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.