Skip to content

etcd slowly increase in size, sessions cleanup missing #5063

@elfranne

Description

@elfranne

Sensu store sessions inside etcd but does not clean up. This will slowly increase the size of etcd, potentially stopping etcd as there is a hard limit at 2GB (default).

Expected Behavior

Clean up old/expired sessions

Current Behavior

Old sessions are kept under /sensu.io/user_sessions/admin/[uuid] inside etcd.

You can see the number of sessions kept in etcd:
etcdctl [insert authentication and endpoint info] --command-timeout=200s --dial-timeout=200s get "/sensu.io/user_sessions/admin" --prefix=true --keys-only | grep -c -v -e '^\s*$' . After a few month we were getting close to 1.7GB, with nearly 5.000.000 keys in the etcd, and over 4.9m just being sessions.

Possible Solution

Quick fix is to delete all sessions:
etcdctl [insert authentication and endpoint info] --command-timeout=200s --dial-timeout=200s del "/sensu.io/user_sessions/admin" --prefix=true
This reduced etcd from 1.7GB to 392MB.

Proper fix would be to clean expired sessions.

Steps to Reproduce (for bugs)

The scale of the issue would probably hard to reproduce but we can see that the sessions are kept in etcd and keeps increasing.

Your Environment

Sensu 6.10 OSS
Ubuntu 22.04 LTS

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions