Go to main content

Creating and Using Oracle® Solaris Kernel Zones

Exit Print View

Updated: December 2018

Tuning the ZFS ARC to Reserve Memory for Kernel Zones

To ensure efficient performance of kernel zones, you must set the user_reserve_hint_pct tunable parameter on the system that is hosting kernel zones. The parameter provides a hint to the system about application memory usage and is used to limit growth of the ZFS Adaptive Replacement Cache (ARC) so that more memory remains available for applications. From the system perspective, a kernel zone itself is an application. Limiting the growth of the ARC ensures that more memory remains available for applications including the kernel zones and the applications running within them.


Caution  -  Failure to set this parameter to limit the host system's ZFS ARC might lead to low memory failures.

To limit the ZFS ARC on the system, as an administrator set the user_reserve_hint_pct parameter in the global zone. The recommendation is to set the parameter value to 80 using a script called set_user_reserve.sh which adjusts the parameter dynamically on a running system.

You could set a value higher or lower than 80, depending on maximum memory requirements of all kernel zones and other processes that are anticipated to run on the host system.

To obtain the set_user_reserve.sh script and see more information about determining requirements and configuring the user_reserve_hint_pct tunable parameter, log in to the My Oracle Support website and access the document Memory Management Between ZFS and Applications in Oracle Solaris 11.x (Doc ID 1663862.1). The set_user_reserve.sh script is attached to that document.

Use the set_user_reserve.sh script to set the parameter. For example, in the global zone on the system named global:

global# ./set_user_reserve.sh -fp 80
Adjusting user_reserve_hint_pct from 0 to 80
Monday, March 30, 2015 04:59:47 PM PST :
waiting for current value : 60 to grow to target : 65

Adjustment of user_reserve_hint_pct to 80 successful.
Make the setting persistent across reboot by adding to /etc/system

# Tuning based on MOS note 1663861.1, script version 1.0
# added Monday, March 30, 2015 05:09:53 PM PST by system administrator : user
set user_reserve_hint_pct=80

Note that when you run the script, the user_reserve_hint_pct parameter is tuned on the running system, but you must set the parameter in /etc/system to make it persist across reboot.