-
Notifications
You must be signed in to change notification settings - Fork 59
[6/N][AMI BuildKit Cache] Add network tuning for high-throughput operations #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||
| set -eu -o pipefail | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Network tuning for high-throughput container image operations | ||||||||||||||||||||
| # Optimized for r6in instances with 100Gbps networking | ||||||||||||||||||||
|
|
||||||||||||||||||||
| echo "=== Configuring network sysctl settings ===" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| cat <<'EOF' | sudo tee /etc/sysctl.d/99-vllm-network.conf | ||||||||||||||||||||
| # Network tuning for high-throughput Docker builds | ||||||||||||||||||||
| # Reference: https://docs.aws.amazon.com/datatransferterminal/latest/userguide/tech-requirements.html | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # BBR congestion control - helps sustained ECR transfers | ||||||||||||||||||||
amrmahdi marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
| net.core.default_qdisc = fq | ||||||||||||||||||||
| net.ipv4.tcp_congestion_control = bbr | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Avoid slow start after idle - helps frequent connections | ||||||||||||||||||||
| net.ipv4.tcp_slow_start_after_idle = 0 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Reasonable buffers (enough for ECR rate) | ||||||||||||||||||||
| net.core.rmem_max = 16777216 | ||||||||||||||||||||
| net.core.wmem_max = 16777216 | ||||||||||||||||||||
| net.ipv4.tcp_rmem = 4096 1048576 16777216 | ||||||||||||||||||||
| net.ipv4.tcp_wmem = 4096 1048576 16777216 | ||||||||||||||||||||
| EOF | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Apply sysctl settings | ||||||||||||||||||||
| sudo sysctl -p /etc/sysctl.d/99-vllm-network.conf | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # ----------------------------------------------------------------------------- | ||||||||||||||||||||
| # Docker daemon configuration for high-throughput registry operations | ||||||||||||||||||||
| # ----------------------------------------------------------------------------- | ||||||||||||||||||||
| echo "=== Configuring Docker daemon ===" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Update Docker daemon config to increase concurrent downloads/uploads | ||||||||||||||||||||
| # Use jq to merge with existing config, or create new if doesn't exist | ||||||||||||||||||||
| if [[ -f /etc/docker/daemon.json ]]; then | ||||||||||||||||||||
| # Merge with existing config | ||||||||||||||||||||
| sudo jq '. + {"max-concurrent-downloads": 16, "max-concurrent-uploads": 16}' /etc/docker/daemon.json | sudo tee /etc/docker/daemon.json.tmp | ||||||||||||||||||||
amrmahdi marked this conversation as resolved.
Show resolved
Hide resolved
amrmahdi marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
| sudo mv /etc/docker/daemon.json.tmp /etc/docker/daemon.json | ||||||||||||||||||||
|
Comment on lines
+38
to
+40
|
||||||||||||||||||||
| # Merge with existing config | |
| sudo jq '. + {"max-concurrent-downloads": 16, "max-concurrent-uploads": 16}' /etc/docker/daemon.json | sudo tee /etc/docker/daemon.json.tmp | |
| sudo mv /etc/docker/daemon.json.tmp /etc/docker/daemon.json | |
| # Merge with existing config using a temporary file for atomic update | |
| tmpfile="$(mktemp /tmp/daemon.json.XXXXXX)" | |
| trap 'rm -f "$tmpfile"' EXIT | |
| if sudo jq '. + {"max-concurrent-downloads": 16, "max-concurrent-uploads": 16}' /etc/docker/daemon.json >"$tmpfile"; then | |
| sudo mv "$tmpfile" /etc/docker/daemon.json | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions 'Reference: https://docs.aws.amazon.com/datatransferterminal/latest/userguide/tech-requirements.html' but this URL appears to be for AWS Data Transfer Terminal, which may not be the most relevant reference for general Docker/ECR network tuning. Consider updating the reference to a more appropriate AWS documentation page for network optimization or removing it if not directly relevant.