自己写了个脚本,不停的去Update某个表,结果发现一晚上之后数据库似乎就开始变的好慢好慢了。CPU占用达到了30-40%也在怀疑难道真的这样压力测试,会使的Postgresql变慢吗?一直在疑惑!
脚本如下:
#!/bin/bash
s=1
port=1
a_address=0
b_address=0
c_address=0
d_address=0
while [ $s != 9000000 ]
do
s=$(($s+1))
port=$(($port+1))
a_address=$(($a_address+1))
b_address=$(($b_address+1))
c_address=$(($c_address+1))
d_address=$(($d_address+1))
psql database sysuser --command "UPDATE gateway set ip_addr = '$a_address.$b_address.$c_address.$d_address', ip_port = '$port', real_ip_addr = '$a_address.$b_address.$c_address.$d_address', activate = 't' WHERE serial = 'le4nin9'";
if [ $port = 65535 ]; then port=1
fi
if [ $a_address = 255 ]; then a_address=0
fi
if [ $b_address = 255 ]; then b_address=0
fi
if [ $c_address = 255 ]; then c_address=0
fi
if [ $d_address = 255 ]; then d_address=0
fi
echo $s >sql.log
done
继续观察了。总之对Postgres有些灰心了,想把系统的数据库转到Oracle去。
阅读(4267) | 评论(2) | 转发(0) |