The default heap size of 500 MiB for HiveMetaStore is not sufficient for production workloads. Increase the heap size when memory pressure causes service degradation.
Prerequisites
Before you begin, ensure that you have:
-
An EMR cluster with the Hive service deployed
-
Sufficient available memory on the host nodes to support the new heap size
If you selected DLF Unified Metadata for the Metadata parameter when creating the cluster, HiveMetaStore is not enabled. This procedure does not apply to HiveMetaStore in that case. For more information about metadatabase types, see Hive metadata.
When to increase memory
Increase the heap size of HiveMetaStore when all of the following symptoms occur at the same time:
-
Queries or jobs take longer than usual due to metadata-related operations
-
HiveMetaStore throws exceptions
-
Garbage collection (GC) metrics for HiveMetaStore exceed their thresholds, indicating memory exhaustion
If the same symptoms occur on HiveServer2, increase the heap size of HiveServer2 instead.
Increase the heap size of HiveMetaStore
-
Go to the Configure tab of the Hive service page.
-
In the search box, enter
hive_metastore_heapsizeand click the search icon.
-
Set the parameter value based on the available memory of your nodes. The default value is 500 MiB. For example, you can change the value to 2048 (2 GiB).
-
Click Save. In the dialog box that appears, enter a value for Execution Reason, and then click Save.
-
On the Status tab, restart HiveMetaStore and verify that the service returns to a running state.
Increase the heap size of HiveServer2
-
Go to the Configure tab of the Hive service page.
-
In the search box, enter
hive_server2_heapsizeand click the search icon. -
Set the parameter value based on the available memory of your nodes. For example, you can change the value to 2048 (2 GiB).
-
Click Save. In the dialog box that appears, enter a value for Execution Reason, and then click Save.
-
On the Status tab, restart HiveServer2 and verify that the service returns to a running state.