今天去一个客户现场,解决人家占用带宽很严重问题。
经过多种监控手段
1、数据库连接池有问题。
2、日志文件太大。
3、数据库oracle安装在32位环境,性能无法优化。
这里说明一下为何会占用大量带宽:
页面显示信息,是通过后台传递数据到前台页面渲染,然后显示导致的。其实这些数据这么大,为啥不生成静态页面,前段页面进行引用啦。这样性能就会好很多。
具体修改proxool数据库配置如下:
proxool数据源,需要添加如下配置
<propertyname="minimumConnectionCount" value="5" />
<propertyname="maximumConnectionCount" value="400" />
<propertyname="prototypeCount" value="10" />
<propertyname="trace" value="true" />
<propertyname="delegateProperties" value=" foo=5" />
<propertyname="houseKeepingSleepTime" value="30000" />
<propertyname="simultaneousBuildThrottle" value="400" />
<propertyname="maximumActiveTime" value="7200000" />
prototypeCount 一旦发现空闲的连接数没达到该值将建链
simultaneousBuildThrottle 一次建链的数量。
maximumConnectionCount 最大的数据库连接数
minimumConnectionCount 最小的数据库连接数
maximumActiveTime 如果houseKeepingSleepTime检测到某个线程的活动时间大于这个数值.它将会杀掉这个线程.所以确认一下你的服务器的带宽.然后定一个合适的值.默认是5分钟.
houseKeepingSleepTime proxool自动侦察各个连接状态的时间间隔(毫秒),侦察到空闲的连接就马上回收,超时的销毁
overloadWithoutRefusalLifetime 满负载时,等待的时长
trace 是否启用日志跟综
如果没有添加的会报很多错误:
错误日志3:
2013-08-30 11:01:15, 384 Could not get JDBCConnection; nested exception is java.sql.SQLException: We are already in theprocess of making 11 connections and the number of simultaneous builds has beenthrottled to 10
org.springframework.jdbc.CannotGetJdbcConnectionException:Could not get JDBC Connection; nested exception is java.sql.SQLException: Weare already in the process of making 11 connections and the number ofsimultaneous builds has been throttled to 10
Could not get JDBC Connection; nestedexception is java.sql.SQLException: We are already in the process of making 11connections and the number of simultaneous builds has been throttled to 10
org.springframework.jdbc.CannotGetJdbcConnectionException:Could not get JDBC Connection; nested exception is java.sql.SQLException: Weare already in the process of making 11 connections and the number ofsimultaneous builds has been throttled to 10
Caused by: java.sql.SQLException: We arealready in the process of making 11 connections and the number of simultaneousbuilds has been throttled to 10