Postgresql数据库压力测试下真的会逐渐变慢吗?

前端之家收集整理的这篇文章主要介绍了Postgresql数据库压力测试下真的会逐渐变慢吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Postgresql数据库压力测试下真的会逐渐变慢吗?

自己写了个脚本,不停的去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))
psqldatabase 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去。
原文链接:https://www.f2er.com/postgresql/196784.html

猜你在找的Postgre SQL相关文章