jedis-cache.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <caches>
  3. <cache name="jedis">
  4. <cache-class>com.chinacreator.cache.redis.JedisCacheManager</cache-class>
  5. <!--
  6. 缓存服务器,格式为ip:port,多个服务器用逗号(,)隔开
  7. // 生成环境
  8. <cache-hosts>114.255.201.234:8080</cache-hosts>
  9. //测试环境
  10. <cache-hosts>202.106.63.1:6379</cache-hosts>
  11. -->
  12. <!-- <cache-hosts>127.0.0.5:8080:r515f2114669tv1f98b0b5330ec0e2sd</cache-hosts>-->
  13. <cache-hosts>127.16.123.5:8080:r515f2114669tv1f98b0b5330ec0e2sd</cache-hosts>
  14. <!-- 172.16.123.5
  15. 连接服务器超时时间
  16. 如果为-1,则表示不限制
  17. -->
  18. <cache-connect-timeout>6000</cache-connect-timeout>
  19. <cache-config>
  20. <!--
  21. 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
  22. -->
  23. <block-when-exhausted>false</block-when-exhausted>
  24. <!--
  25. 设置的逐出策略类名, 默认DefaultEvictionPolicy(当连接超过最大空闲时间,或连接数超过最大空闲连接数)
  26. -->
  27. <eviction-policy-class-name>org.apache.commons.pool2.impl.DefaultEvictionPolicy</eviction-policy-class-name>
  28. <!--
  29. 是否启用pool的jmx管理功能, 默认true
  30. -->
  31. <jmx-name-prefix>pool</jmx-name-prefix>
  32. <!--
  33. 是否启用后进先出, 默认tru
  34. -->
  35. <lifo>true</lifo>
  36. <!--
  37. 最大空闲连接数,默认8个
  38. -->
  39. <max-idle>8</max-idle>
  40. <!--
  41. 最大连接数, 默认8个
  42. -->
  43. <max-total>1024</max-total>
  44. <!--
  45. 获取连接时的最大等待毫秒数(如果设置为阻塞时BlockWhenExhausted),如果超时就抛异常, 小于零:阻塞不确定的时间, 默认-1
  46. -->
  47. <max-wait-millis>-1</max-wait-millis>
  48. <!--
  49. 逐出连接的最小空闲时间 默认1800000毫秒(30分钟)
  50. -->
  51. <min-evictable-idle-time-millis>1800000</min-evictable-idle-time-millis>
  52. <!--
  53. 每次逐出检查时 逐出的最大数目 如果为负数就是 : 1/abs(n), 默认3
  54. -->
  55. <num-tests-per-eviction-run>3</num-tests-per-eviction-run>
  56. <!--
  57. 对象空闲多久后逐出, 当空闲时间>该值 且 空闲连接>最大空闲数 时直接逐出,不再根据MinEvictableIdleTimeMillis判断 (默认逐出策略)
  58. -->
  59. <soft-min-evictable-idle-time-millis>1800000</soft-min-evictable-idle-time-millis>
  60. <!--
  61. 在获取连接的时候检查有效性, 默认false
  62. -->
  63. <test-on-borrow>true</test-on-borrow>
  64. <!--
  65. 在空闲时检查有效性, 默认false
  66. -->
  67. <test-while-idle>true</test-while-idle>
  68. <!--
  69. 逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1
  70. -->
  71. <time-between-eviction-runs-millis>-1</time-between-eviction-runs-millis>
  72. </cache-config>
  73. </cache>
  74. </caches>