shiro.session There is no session with id问题点排查

为什么80%的码农都做不了架构师?>>>   hot3.png

SSM+shiro+redis 做分布式项目时,在生产环境中遇到 org.apache.shiro.session.UnknownSessionException: There is no session with id

这个bug。排查了之后。问题点有以下两种:

(1):shiro的JSESSIONID 与Tomcat 、Jetty默认的JSESSIONID 冲突了。这时候需要改一下shiro对应的JSESSIONID:


   	 
	 
         
	     
	
	 
	 
    
        
        
        
		  
    

(2)排查redis的配置的maxmemory 是否设置有误:

# NOTE: since Redis uses the system paging file to allocate the heap memory,
# the Working Set memory usage showed by the Windows Task Manager or by other
# tools such as ProcessExplorer will not always be accurate. For example, right
# after a background save of the RDB or the AOF files, the working set value
# may drop significantly. In order to check the correct amount of memory used
# by the redis-server to store the data, use the INFO client command. The INFO
# command shows only the memory used to store the redis data, not the extra
# memory used by the Windows process for its own requirements. Th3 extra amount
# of memory not reported by the INFO command can be calculated subtracting the
# Peak Working Set reported by the Windows Task Manager and the used_memory_peak
# reported by the INFO command.
#
# maxmemory 
maxmemory 6000000000

我的生产环境是window Server 32G 的。原先配置的是32G的3/4 但这样设置每过一段时间就出现这样的bug。我假设内存是8G,配置了8G的3/4。就解决这个问题了

转载于:https://my.oschina.net/linwl/blog/1830698

你可能感兴趣的:(shiro.session There is no session with id问题点排查)