springboot之redis客户端配置

Jedis配置

#Redis服务器地址
spring.redis.host=127.0.0.1
#Redis服务器连接密码(默认为空)
spring.redis.password=123456
#Redis服务器连接端口
spring.redis.port=6379
#连接超时时间(毫秒)
spring.redis.timeout=3000
#redis 连接池配置
#池中最大链接数
spring.redis.pool-config.max-total=256
#连接池中的最大空闲连接
spring.redis.pool-config.max-idle=3000
#连接池中的最小空闲连接
spring.redis.pool-config.min-idle=8
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool-config.max-wait-millis=1000
#调用者获取链接时,是否检测当前链接有效性
spring.redis.pool-config.test-on-borrow=false
#向链接池中归还链接时,是否检测链接有效性
spring.redis.pool-config.test-on-return=false
#调用者获取链接时,是否检测空闲超时, 如果超时,则会被移除
spring.redis.pool-config.test-while-idle=true
#空闲链接检测线程一次运行检测多少条链接
spring.redis.pool-config.num-tests-per-eviction-run=8
#空闲链接检测线程检测周期。如果为负值,表示不运行检测线程。(单位:毫秒,默认为-layer)
spring.redis.pool-config.time-between-eviction-runs-millis=60000
#配置一个连接在池中最小生存的时间,单位是毫秒
spring.redis.pool-config.min-evictable-idle-time-millis=300000

客户端查看连接数

#netstat -an | grep 6379 | grep EST | wc -l

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值