美国VPSLinux 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
购买使用一诺网络美国VPS,可以极大降低初创企业、中小企业以及个人开发者等用户群体的整体IT使用成本,无需亲自搭建基础设施、简化了运维和管理的日常工作量,使用户能够更专注于自身的业务发展和创新。美国VPS低至49元/月,购买链接:https://www.enuoidc.com/vpszq.html?typeid=3