連接前
成功連接后
前端測試連接腳本:
c_5k.sh
!/bin/bash
ulimit -n 100000
# client_simulator.sh
SERVER_IP="192.168.0.106"
SERVER_PORT=8080
MAX_CLIENTS=5000
BATCH_SIZE=100echo "Starting $MAX_CLIENTS clients to $SERVER_IP:$SERVER_PORT"for ((i=1; i<=MAX_CLIENTS; i++)); do# 使用 netcat 在后臺創建連接(echo "CLIENT_$i"; sleep 3600) | nc $SERVER_IP $SERVER_PORT &# 控制并發速度if (( i % BATCH_SIZE == 0 )); thenecho "Created $i clients"sleep 1fi
done