-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Partitions/RedisClusterNode representation #715
Labels
type: feature
A new feature
Milestone
Comments
Benchmarks: Backed by
Backed by
|
mp911de
added a commit
that referenced
this issue
Mar 12, 2018
Lettuce now uses BitSet to represent internally cluster slots assigned to a cluster node. The slot storage is allocated lazily and nodes without a slot (non-slot masters, slave nodes) won't allocate any memory for the slot storage. This change reduces the memory usage from the previously used ArrayList with initially 16 elements backed by an Object[]. A node with all slots assigned required about 325.000 bytes of memory. Using a BitSet stores only bitwise whether a slot is assigned or not. The storage requires a fixed amount of memory (about 2184 bytes) for each node independent of how many slots are occupied. A cluster of 150 nodes reached the break-even between the previous and current pattern if at least a single slot is used on a particular node. Clusters with more nodes will have always a higher memory consumption if at least a single slot is occupied.
mp911de
added a commit
that referenced
this issue
Mar 12, 2018
Lettuce now uses BitSet to represent internally cluster slots assigned to a cluster node. The slot storage is allocated lazily and nodes without a slot (non-slot masters, slave nodes) won't allocate any memory for the slot storage. This change reduces the memory usage from the previously used ArrayList with initially 16 elements backed by an Object[]. A node with all slots assigned required about 325.000 bytes of memory. Using a BitSet stores only bitwise whether a slot is assigned or not. The storage requires a fixed amount of memory (about 2184 bytes) for each node independent of how many slots are occupied. A cluster of 150 nodes reached the break-even between the previous and current pattern if at least a single slot is used on a particular node. Clusters with more nodes will have always a higher memory consumption if at least a single slot is occupied.
mp911de
added a commit
that referenced
this issue
Mar 12, 2018
Lettuce now uses BitSet to represent internally cluster slots assigned to a cluster node. The slot storage is allocated lazily and nodes without a slot (non-slot masters, slave nodes) won't allocate any memory for the slot storage. This change reduces the memory usage from the previously used ArrayList with initially 16 elements backed by an Object[]. A node with all slots assigned required about 325.000 bytes of memory. Using a BitSet stores only bitwise whether a slot is assigned or not. The storage requires a fixed amount of memory (about 2184 bytes) for each node independent of how many slots are occupied. A cluster of 150 nodes reached the break-even between the previous and current pattern if at least a single slot is used on a particular node. Clusters with more nodes will have always a higher memory consumption if at least a single slot is occupied.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A partitions object with a single node holding all 16384 slots requires about 300000 bytes, most of that is used by the slot list.
We should investigate whether a slot set (storing slots as bits, similar to a jumbo
EnumSet
holding states in 256 long values) could help here.The text was updated successfully, but these errors were encountered: