This commit is contained in:
Alex Yang
2026-01-16 11:09:11 +08:00
parent 8159577be0
commit cdac4fcf43
284 changed files with 2813570 additions and 14 deletions

28
dns/test_dns_perf.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# DNS性能测试脚本
SERVER="127.0.0.1"
DOMAIN="example.com"
THREADS=10
QUERIES=1000
# 创建临时文件存储进程ID
pids=()
# 运行并发查询
for ((i=1; i<=THREADS; i++)); do
for ((j=1; j<=$((QUERIES/THREADS)); j++)); do
dig @$SERVER $DOMAIN A +short > /dev/null &
pids+=($!)
done
echo "线程 $i 已启动,将执行 $((QUERIES/THREADS)) 个查询"
done
echo "所有查询已启动,等待完成..."
# 等待所有查询完成
for pid in "${pids[@]}"; do
wait $pid
done
echo "所有查询已完成!"