mcserver/docs/infrastructure-base.md
2026-08-10 14:24:14 -04:00

1.5 KiB

Infrastructure & Host Baseline Setup Guide

1. Cloud Hardware Baseline

  • Provider: Oracle Cloud Infrastructure (OCI)
  • Architecture: Ampere A1 Flex (aarch64 / ARM64)
  • Resources: 4 OCPUs (Neoverse N1), 24 GB System RAM
  • Memory Strategy:
    • Container JVM Heap (-Xmx12G -Xms12G): Allocated per instance manifest
    • Host OS & Page Cache: Minimum 12 GB reserved for kernel, filesystem page cache, and Docker daemon overhead

2. Host OS & Network Optimization

Firewall Configuration (UFW)

Allocate port ranges to support primary and secondary instances:

# Primary Instance Ports (Java + Simple Voice Chat)
sudo ufw allow 25565/tcp comment 'MC Java Port - Primary Instance'
sudo ufw allow 24454/udp comment 'Voice Chat Port - Primary Instance'

# Secondary Instance Ports
sudo ufw allow 25566/tcp comment 'MC Java Port - Secondary Instance'
sudo ufw allow 24455/udp comment 'Voice Chat Port - Secondary Instance'

sudo ufw enable

Linux Kernel TCP Optimization (BBR + FQ)

Enable Bottleneck Bandwidth and RTT (BBR) congestion control to minimize network latency:

sudo modprobe tcp_bbr
sudo bash -c 'cat <<EOF > /etc/sysctl.d/99-minecraft.conf
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF'
sudo sysctl --system

3. Host Ownership Safeguard

Ensure host user retains ownership of container data to prevent PermissionError (EACCES):

sudo chown -R $USER:$USER ./data
chmod -R u+rwX ./data