Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
March 2018
Oded Shopen
About Me
Oded Shopen ▪
Software Architect @ Amdocs Israel ▪
Working on Event-Driven, Cloud Native Microservices ▪
🤓 Redis Geek ▪
▪ http://odedia.org
▪ @odedia on twitter
Load Balancer
Load Balancer
Tomcat Tomcat
Load Balancer
Tomcat
Tomcat Tomcat Tomcat
Tomcat Tomcat Tomcat
Tomcat
Tomcat Tomcat Tomcat
Tomcat
Tomcat Tomcat
Tomcat Tomcat Tomcat Tomcat
Load Balancer
Tomcat
Tomcat Tomcat Tomcat
Tomcat Tomcat Tomcat
Tomcat
Jetty Tomcat Tomcat
Tomcat
Tomcat Tomcat
Jetty Jetty Tomcat Tomcat
Tomcat
Session Data
Tomcat Tomcat
Jetty
Tomcat
Tomcat
Tomcat
Tomcat
Session Data
https://docs.spring.io/spring-session/docs/1.3.1.RELEASE/reference/html5/
Node 1
spring.redis.sentinel.master=MasterNode
spring.redis.url=proxy:6379 Proxy
Node 2
spring.redis.sentinel.nodes=Node1:6379,Node2:6379,Node3:6379
Node 3
Information Security Level 2 – Sensitive
20 © 2017 – Proprietary & Confidential Information of Amdocs
#2 Pool Settings
▪ Spring Data Redis uses a JedisConnectionFactory with the following defaults:
spring.redis.pool.max-active=8
spring.redis.pool.max-idle=8
spring.redis.pool.max-wait=-1
spring.redis.pool.min-idle=0
spring.redis.timeout=0
▪ Behind the scenes - an Apache Commons GenericObjectPool.
▪ Use max-active based on your tomcat/jetty threads.
▪ Use max-wait based on your setup
▪ Too high - all tomcat threads can get stuck, waiting
▪ Too low - your consumers may get errors
▪ Use min-idle of at least 8 to offset “sudden load” issues (such as mass login on a business day).
▪ Set spring.redis.timeout to a reasonably low number (such as 1000ms)
▪ Too high - your connection pool can become full quickly.
▪ Too low - your consumers may get errors
Tomcat Tomcat
Jetty
Tomcat
Tomcat
Tomcat
Tomcat
Session Data
Tomcat Tomcat
Jetty
Tomcat
Tomcat
Tomcat
Tomcat
Session Data
▪ You can also disable registering to those expiration and deletion events. Note that all servers need to
disable the registering for this to work:
@EnableRedisHttpSession
public class RedisOperationsSessionRepositoryConfigNoOp {
@Bean
public static ConfigureRedisAction configureRedisAction() {
return ConfigureRedisAction.NO_OP;
}
}
http://odedia.org