连接前
成功连接后
前端测试连接脚本:
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