- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
Linux CPU压力测试脚本
蓝队云小课堂:
需要安装cpuburn-in工具
#!/bin/bash
cd /1/cpuburn-in
#mkdir yes
#pwd
declare -i m
m=$1+1
echo $m
for i in `seq "$1"`
do
./cpuburn-in 500000 1>/dev/null &
done
#kill cpuburn-in process
echo "please input y quit!"
read J
echo $J
if [ $J == y ]
then
for k in `seq "$m"`
do
num2=`ps -ef | grep "./cpuburn-in" |sed -n ''$k'p' | awk -F " " '{print $4}'`
echo "this is $num2"
if [ $num2 == 0 ]
then
continue
fi
num[k]=`ps -ef | grep "./cpuburn-in" | sed -n ''$k'p' | awk -F " " '{print $2}'`
echo "that is $num"
done
for n in `seq "$1"`
do
#echo "${num[n]}"
kill -9 ${num[n]}
done
fi
更多小知识,可联系蓝队云一起探讨。
售前咨询
售后咨询
备案咨询
二维码
TOP