This guide documents performance characteristics of azlin commands and best practices for minimizing Azure API costs and latency.
| Command | Default Latency | API Calls | Cacheable | Optimization |
|---|---|---|---|---|
azlin list |
0.5-1s | 1 (single RG) | No | Use default RG |
azlin list --show-all-vms |
10-30s | N (all RGs) | No | Avoid unless needed |
azlin list --show-quota |
+2-8s | 1 per region | Yes (5min) | Use --no-quota for speed |
azlin list --show-tmux |
+1-3s | 1 per VM | No | Use --no-tmux for speed |
azlin new |
3-5min | ~10-15 | No | Cannot optimize |
azlin connect |
<1s | 0 | No | Already fast |
Fast ✅:
# Set default RG once
echo 'default_resource_group = "my-rg"' >> ~/.azlin/config.toml
# Fast queries forever
azlin list # 0.5-1sSlow ❌:
# No configured RG, forced to use --show-all-vms
azlin list --show-all-vms # 10-30s every timeFast ✅:
azlin list --no-quota # Skip 2-8s of quota API callsUse quota only when needed:
azlin list --show-quota # When capacity planningFast ✅:
azlin list --no-tmux # Skip 1-3s of SSH connectionsFastest possible list:
azlin list --no-quota --no-tmux # 0.3-0.5sDefault (balanced):
azlin list # 2-4s with quota & tmuxaz vm list --resource-group <rg> --show-details(0.5-1s)az network public-ip list --resource-group <rg>(0.3-0.5s, batched)- If
--show-quota(default):az vm list-usage --location <region>per region (1-3s each) - If
--show-tmux(default): SSH to each running VM (0.5-1s each, parallel max 10)
Total: 2-8s depending on number of VMs and regions
az vm list(NO --resource-group) (10-30s for large subscriptions)az vm showfor each VM to get tags (N API calls)- Same quota & tmux overhead as default
Total: 10-60s depending on subscription size
- Parallelization: ThreadPoolExecutor with max_workers=10
- Cache: 5-minute TTL per region:quota pair
- API:
az vm list-usage --location <region>
| Scenario | Regions | API Calls | Latency | Cached Benefit |
|---|---|---|---|---|
| Single region | 1 | 1 | 1-2s | 5 min reuse |
| Multi-region | 3 | 3 (parallel) | 2-3s | 5 min reuse |
| Many regions | 5+ | 5+ (parallel, max 10) | 3-8s | 5 min reuse |
- ✅ Capacity planning near limits
- ✅ Multi-region deployments
- ✅ Team quota monitoring
- ❌ Dev/test with abundant quota (most users)
For most dev/test users (95%+ of quota available):
# Add to your shell alias
alias azl='azlin list --no-quota --no-tmux' # Fast 0.3-0.5sSee open issues:
# Time a command
time azlin list
# Compare with optimizations
time azlin list --no-quota --no-tmuxAzure API calls are free (within rate limits), but latency impacts developer productivity:
| Daily Lists | Default (3s) | Optimized (0.5s) | Time Saved |
|---|---|---|---|
| 10 | 30s | 5s | 25s/day |
| 50 | 150s (2.5min) | 25s | 125s/day |
| 100 | 300s (5min) | 50s | 250s/day (4min) |
For teams checking VMs frequently, optimizations save significant time!