一键导入
multi-server-distribution
Distribute ISUPIPE components across 3 contest VMs for optimal resource utilization — DB on vm1, App workers on vm2/vm3
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Distribute ISUPIPE components across 3 contest VMs for optimal resource utilization — DB on vm1, App workers on vm2/vm3
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
MCP tool reference — exec, benchmark_start, benchmark_status, note_write, etc. Use when: executing commands on VMs, running benchmarks, or recording findings
ISUCON13 contest manual — server topology, service management, benchmark execution, and rules. Use when: checking environment setup, running benchmarks, or understanding contest constraints
ISUPipe application manual — features, terms, constraints, and API specs. Use when: understanding the app domain, checking API behavior or MUST/MAY requirements
General strategy for identifying and adding missing database indexes in ISUCON web applications
General techniques for optimizing user icon/avatar image serving in ISUCON web applications
General techniques for identifying and fixing N+1 query problems in ISUCON web applications
| name | multi-server-distribution |
| description | Distribute ISUPIPE components across 3 contest VMs for optimal resource utilization — DB on vm1, App workers on vm2/vm3 |
The initial setup runs all components on each VM. Distributing them across VMs eliminates resource contention.
| VM | Components | Role |
|---|---|---|
| vm1 (10.0.1.4) | MySQL, PowerDNS, nginx (load balancer) | Database + DNS + LB |
| vm2 (10.0.1.5) | Go app (isupipe-go), nginx (local proxy) | App worker 1 |
| vm3 (10.0.1.6) | Go app (isupipe-go), nginx (local proxy) | App worker 2 |
exec host="vm1" command="sudo sed -i 's/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf"
exec host="vm1" command="sudo mysql -u isucon -pisucon -e \"GRANT ALL PRIVILEGES ON *.* TO 'isucon'@'%' IDENTIFIED BY 'isucon'; FLUSH PRIVILEGES;\""
exec host="vm1" command="sudo systemctl restart mysql"
On vm2 and vm3, update the Go app environment:
# vm2
exec host="vm2" command="sudo sed -i 's|ISUCON13_MYSQL_DIALCONFIG_ADDRESS=.*|ISUCON13_MYSQL_DIALCONFIG_ADDRESS=10.0.1.4|' /home/isucon/env.sh"
exec host="vm2" command="sudo systemctl restart isupipe-go"
# vm3
exec host="vm3" command="sudo sed -i 's|ISUCON13_MYSQL_DIALCONFIG_ADDRESS=.*|ISUCON13_MYSQL_DIALCONFIG_ADDRESS=10.0.1.4|' /home/isucon/env.sh"
exec host="vm3" command="sudo systemctl restart isupipe-go"
exec host="vm1" command="sudo tee /etc/nginx/sites-enabled/isupipe.conf << 'NGINX'
upstream app {
server 10.0.1.5:443;
server 10.0.1.6:443;
}
server {
listen 443 ssl;
server_name *.u.isucon.dev;
ssl_certificate /etc/nginx/tls/_.u.isucon.dev.crt;
ssl_certificate_key /etc/nginx/tls/_.u.isucon.dev.key;
location / {
proxy_pass https://app;
proxy_http_version 1.1;
proxy_set_header Connection \"\";
proxy_set_header Host \\$host;
}
}
NGINX"
exec host="vm1" command="sudo nginx -t && sudo systemctl reload nginx"
# Stop MySQL on vm2/vm3 (using vm1's MySQL now)
exec host="vm2" command="sudo systemctl stop mysql && sudo systemctl disable mysql"
exec host="vm3" command="sudo systemctl stop mysql && sudo systemctl disable mysql"
# Stop Go app on vm1 (vm1 is DB+LB only)
exec host="vm1" command="sudo systemctl stop isupipe-go && sudo systemctl disable isupipe-go"
Update DNS to return vm2/vm3 IPs for streaming subdomains:
exec host="vm1" command="mysql -u isucon -pisucon isudns -e \"UPDATE records SET content='10.0.1.5' WHERE type='A' AND name LIKE '%.u.isucon.dev' LIMIT 1;\""
exec host="vm1" command="curl -sk https://pipe.u.isucon.dev/api/tag"