-
-
Notifications
You must be signed in to change notification settings - Fork 37
PerformanceTuning.md
Chris edited this page Apr 22, 2025
·
2 revisions
DockFlare includes features designed to optimize its performance, especially during startup and when managing a large number of ingress rules, and to avoid hitting Cloudflare API rate limits.
- Problem: When DockFlare starts or detects many container changes simultaneously, it might try to create or delete numerous DNS records at once. The Cloudflare API has rate limits, and excessive concurrent requests can lead to errors.
- Solution: DockFlare limits the number of DNS operations (create/delete CNAME records) that can run in parallel.
-
Configuration:
-
MAX_CONCURRENT_DNS_OPS
: Environment variable controlling the maximum number of simultaneous DNS operations. -
Default:
3
-
Tuning: If you encounter rate-limiting errors (often HTTP 429 errors in logs) during busy periods, you might consider decreasing this value (e.g., to
2
or1
). If you have a high API limit and want faster updates for many records, you might cautiously increase it, but the default is generally safe.
-
-
Problem: During startup reconciliation (comparing Docker state, saved state, and Cloudflare state), processing potentially hundreds of DNS records sequentially can be slow, and processing them all concurrently risks rate limiting (addressed by
MAX_CONCURRENT_DNS_OPS
). - Solution: DockFlare processes DNS records that need checking or updating during reconciliation in smaller batches. This provides progress feedback and spreads the load.
-
Configuration:
-
RECONCILIATION_BATCH_SIZE
: Environment variable controlling how many DNS records are processed in each batch during startup reconciliation. -
Default:
3
-
Tuning: This value interacts with
MAX_CONCURRENT_DNS_OPS
. A smaller batch size provides more granular progress updates in the UI/logs. Larger batches might slightly speed up reconciliation if rate limits aren't a concern, but the default is usually adequate.
-
- Feedback: The Web UI often shows progress indicators during this batched reconciliation phase (e.g., "Reconciling DNS: Batch 5/20").
- Problem: Initializing connections, checking the tunnel, potentially starting the agent, and performing reconciliation can take time, especially on slower systems or networks. Waiting for all this before the UI is available can be inconvenient.
- Solution: DockFlare's Web UI becomes available relatively quickly, even while background initialization and reconciliation tasks are still running.
- Feedback: The UI provides status indicators (e.g., "Initializing", "Reconciling", "Running") to show the current state of the application. You can access logs even while initialization is in progress.
These optimizations aim to make DockFlare robust and efficient, particularly in environments with many containers or frequent changes, while respecting Cloudflare API limits.
- Home
- Getting Started
- Core Concepts
- Configuration
- Usage Guide
- Advanced Topics
- Troubleshooting
- Contributing
- License