This topic describes how to set the maximum memory for an OceanBase database and provides configuration examples.
Parameters used to set the maximum memory for an OceanBase database
OceanBase Database provides the following parameters for you to set the maximum memory for an OceanBase database:
memory_limit_percentage: specifies the percentage of maximum server memory that can be occupied by an OceanBase database.memory_limit: specifies the maximum memory for an OceanBase database. If thememory_limitparameter is set to0, thememory_limit_percentageparameter prevails. Otherwise, thememory_limitparameter prevails.
Examples
The following table provides two configuration examples in which the maximum server memory is 100 GB. Below the table, how the memory_limit_percentage and memory_limit parameters affect the maximum memory of an OceanBase database is described.
| Example | memory_limit_percentage | memory_limit | Maximum memory of an OceanBase database |
|---|---|---|---|
| Example 1 | 80 | 0 | 80 GB |
| Example 2 | 80 | 90 GB | 90 GB |
In Example 1, the
memory_limitparameter is set to0. Therefore, thememory_limit_percentageparameter prevails, and the maximum memory of the OceanBase database is 80 GB, which is calculated by multiplying 100 GB and 80%.In Example 2, the
memory_limitparameter is set to 90 GB. Therefore, thememory_limitparameter determines the maximum memory of the OceanBase database, which is 90 GB.
Notice
Mainstream OceanBase Database servers are usually configured with 384 GB or 512 GB memory. We recommend that you allocate 80% of the 384 GB server memory or 90% of the 512 GB server memory to an OceanBase database.