4

I have an AWS Elasticache Redis instance that I'm using as a backing for Spring Session.

Looking at the console most of the metrics seem to be ok, but I'm concerned that the swap usage is growing like there's some sort of memory leak.

I'm new to Redis and Spring Session. Is this something I should be concerned about? How can I resolve this?

For reference, here's a screenshot: stack continuing to grow

Tyler B
  • 308
  • 2
  • 9
  • Is this the swap for the Redis instance or your Java app? – Rob Winch Oct 17 '15 at 21:39
  • This swap graph is specifically for the Redis instance. – Tyler B Oct 17 '15 at 22:12
  • Anything else using the Redis? Are the number of keys growing? Spring Session keys should have ttl on them. Any bots hitting your service that create sessions (search engine crawler, health checks, etc)? – Rob Winch Oct 17 '15 at 22:41
  • I do have monitoring and a load balancer health check, so those would probably create a session. Any way to disable session creation for specific endpoints? The number of keys isn't growing. All the other graphs seem normal. – Tyler B Oct 25 '15 at 00:38
  • To prevent a session from being created ensure that you don't invoke HttpServletRequest.getSession() or HttpServletRequest.getSession(true) – Rob Winch Oct 25 '15 at 15:05
  • Is there a way I can empirically discover if I am actually creating a session or not for an endpoint? – Tyler B Nov 02 '15 at 06:27
  • Yes. If the response contains a session id (i.e. SESSION cookie) – Rob Winch Nov 02 '15 at 15:12

0 Answers0