此内容没有您所选择的语言版本。
Chapter 1. Capacity planning
Data in Red Hat Data Grid is either stored as plain Java objects or in a serialized form, depending on operating mode (embedded or server) or on specific configuration options such as store-as-binary. Data size can be estimated using sophisticated tools like Java Object Layout and the total amount of required memory can be roughly estimated using the following formulas:
Equation 1.1. Total Data Set in library mode
Equation 1.2. Total Data Set in server mode
Term overhead
is used here as an average amount of additional memory (e.g. expiration or eviction data) needed for storing an Entry in a Cache.
In case of Local or Replicated mode, all data needs to fit in memory, so calculating the amount of required memory is trivial.
Calculating memory requirements for Distributed mode is slightly more complicated and requires using the following:
Equation 1.3. Required memory in Distributed mode
Where:
-
Total Data Set
- Estimated size of all data -
Nodes
- The number of nodes in the cluster -
Node Failures
- Number of possible failures (alsonumber of owners - 1
)
Calculated amount of memory should be used for setting Xmx
and Xms
parameters.
JVM as well as Red Hat Data Grid require additional memory for other tasks like searches, allocating network buffers etc. It is advised to allocate no more than 50% of memory with living data when using Red Hat Data Grid solely as a caching data store, and no more than 33% of memory with living data when using Red Hat Data Grid to store and analyze the data using querying, distributed execution or distributed streams.
When considering large heaps, make sure there’s enough CPU to perform garbage collection efficiently.