RedisPoolConfig---Apache Commons-pool2

      maxTotal: 8 #允许创建资源的最大数量,默认值 8,-1 代表无数量限制

      maxIdle: 8 #最大空闲资源数,默认值 8

      minIdle: 0 #最小空闲资源数,默认值 0

      lifo: true #资源的存取数据结构,默认值 true
      #true: always returning the most recently used object from the pool
      #false: always returns the oldest object in the idle object pool

      fairness: false #默认值 false
      #Returns whether or not the pool serves threads waiting to borrow objects fairly;
      #True means that waiting threads are served as if waiting in a FIFO queue.

      BlockWhenExhausted: #默认值 true,当资源耗尽时,是否阻塞等待获取资源

      maxWaitMillis: -1 #获取资源时的等待时间,单位毫秒,默认值 -1
      #当 blockWhenExhausted 配置为 true 时,此值有效。 -1 代表无时间限制,一直阻塞直到有可用的资源

      minEvictableIdleTimeMillis: 1800000 #资源最小空闲时间, 默认值 1800000,单位 毫秒
      #当前时间与资源最后一次活跃时间差值大于此值,则关闭该资源。 -1表示不移除

      softMinEvictableIdleTimeMillis: 1800000 #软资源最小空闲时间, 默认值 1800000,单位 毫秒
      #当前时间与资源最后一次活跃时间差值大于此值,则关闭该资源,且保留“minIdle”个空闲连接数。 -1表示不移除

      numTestsPerEvictionRun: #返回每次运行空闲对象收回器线程期间要检查的最大对象数。默认值 3
      #设置为 小于0时,回收资源的个数为 (int)Math.ceil( 池中空闲资源个数 / Math.abs(numTestsPerEvictionRun) )
      #设置为 大于0时,回收资源的个数为 Math.min( numTestsPerEvictionRun,池中空闲的资源个数 );

      testOnCreate: #默认值 false
      # 当设置为true时,只有当创建资源时才会调用 factory.validateObject() 方法检测对象,若检查对象失败,则获取资源失败

      testOnBorrow: #默认值 false
      #当设置为true时,每次从池中获取资源时都会调用 factory.validateObject() 方法

      testOnReturn: #默认值 false
      #设置为 true 时,当将资源返还个资源池时候,验证资源的有效性

      testWhileIdle: #默认值 false
      #设置为 true 时,是否检查空闲的资源

      timeBetweenEvictionRunsMillis: -1 #回收资源线程的执行周期,单位毫秒。默认值 -1,负数表示不启用线程回收资源

      evictionPolicyClassName: org.apache.commons.pool2.impl.DefaultEvictionPolicy
      #资源回收策略, 默认值 org.apache.commons.pool2.impl.DefaultEvictionPolicy(String类型)

      jmxEnabled:
      jmxNameBase:
      jmxNamePrefix:

猜你喜欢

转载自blog.csdn.net/Tiggcat/article/details/89029306