Huge Pages enables the Linux kernel to manage large pages of memory in addition to the standard 4KB page size. If you have a system with more than 16GB of memory running Oracle databases with a total System Global Area (SGA) larger than 8GB, you should enable the HugePages feature to improve database performance.
If Huge Pages is enabled but the system isn't configured to allow for the requested huge page allocation excessive swapping will occur. This will result in degraded database performance.
To ensure this doesn't happen a user defined metric can be created in Enterprise Manager to notify administrators if the system is incorrectly configured.
The following will describe the process of creating the User defined Metric in Enterprise Manager
Create the script that will be uploaded to the OMS:
1.On your local machine create a file called check_hugepage_usage.sh that contains the following
RECD_SIZE=0
CFG_TOTAL=`grep HugePages_Total /proc/meminfo | awk '{print $2}'`
SIZE=$((`grep Hugepagesize /proc/meminfo | awk '{print $2}'` * 1024))
for SHMSEGS in `ipcs -m | awk '{print $5}' | sed -n '4,$p'`
do
SEGSIZE=$(($SHMSEGS / $SIZE))
if [ $SEGSIZE -gt 0 ]; then
RECD_SIZE=$(($RECD_SIZE+$SEGSIZE+1))
fi
done
DIFF=$(($RECD_SIZE-$CFG_TOTAL))
echo $RECD_SIZE:$CFG_TOTAL:$DIFF
Next create the metric extension
1.Create the metric extension in the Enterprise Manager Console
Enterprise-->Monitoring-->Metric Extensions
Select the create button-->Metric Extension
2.On the General Properties Screen set the following
Target type select "Host"
Name "huge_page_monitoring"
Display Name "Huge Page Monitoring"
Adapter "OS Command - Multiple Columns"
Data Collection "Enabled"
Repeat Every "12 Hours"
Use of Metric Data "Alerting and Historical Trending"
Upload Interval "1 Collections"
Select the Next Button
3.On the “Adapter" page enter the following
Command '\/bin\/ksh'
Select the upload button by the “Script” text box and upload the file created in step 1
Delimiter ":"
Select the upload button and select the file created in step 1
Select the Next button
4.On the "Create New : Columns" page Use the Add-->New metric column button create three columns with the add button
Column one should be setup as:
Name "Recommended_Value"
Display Name "Recommended_Value"
Column Type "Data Column"
Value Type "Number"
Metric Category "Capacity"
Column two should be setup as:
Name "Configured_Value"
Display Name "Configured Value"
Column Type "Data Column"
Value Type "Number"
Metric Category "Capacity"
Comparison Operator ">"
Critical "0"
Column three should be setup as:
Name "Huge_Page_Shortage"
Display Name "Configured Value"
Column Type "Data Column"
Value Type "Number"
Metric Category "Capacity"
Comparison Operator ">"
Critical "0"
After Setting up the three columns select the next button
5. On The Credentials Screen
Select the “Default Monitoring Credentials” radio button
Click the next button
6.On the “Create New : Test” page
Add a target to test with in the “Test Targets” section
Click the “Run Test” button and ensure that results are displayed properly in the “Test Results” box.
The results should be similar to below
Target NameRecommended ValueConfigured ValueHuge Page Shortage
Targetname31745360000
Click the Finish button
7.Next the Metric Extension must be saved as a deployable draft. This is accomplished on the main metric extension page. This allows the metric to be deployed to targets for testing. However at this stage only the developer has access to publish the metric. After satisfactory testing is completed the metric is then published. This is once again accomplished from the main metric extension page.
8.Once testing is complete and the Metric extension is deployable. It can be deployed to targets. This is accomplished from the metric extension page
Highlight the metric extension just created. From the Actions drop down box select “Deploy to Targets…”
To ensure that administrators are notified in the event the metric created fails an incident rule should be created.
1. To Begin navigate to the Incident Rules Home Page
From the Setup button on the upper right hand corner of the Enterprise Overview Page
Setup->Incidents->Incident Rules
Now click the “Create Rule Set.” button
2.On the Create Rule Set screen enter the following information
Name: Whatever the rule should be called. i.e. Metric Collection Error Rule
Enabled Box: Should be checked
Type: Enterprise
Applies To: Targets
Select the “All Targets of Type” radio button on the bottom of the screen followed by Host in the drop down box
3.Now select the “Rules” tab at the bottom of the screen
4.Chose the "Create.." button on the middle of the screen
5.On the “Select Type of Rule to Create” Popup box select the “Incoming events and updates to events” radio button. Click the continue button.
6.On the “Create New Rule: Select Events” screen check the type check box. In the drop down select “Metric Alert". Click the next button
7. Select the “Add” button
On the “Add conditional Actions” page you can specify conditions that must occur for the action to apply, if an incident should be created and email notifications. Specify the desired properties and select the continue button.
8.On the Target Type drop down select “Host”
Select the search button and select the metric extension created above
Select the check box next to the desired metric
Select the desired severity status in the check boxes at the bottom of the screen
Click the “OK” button
9.Click the “Next” button back on the “Add Actions” page
10.Click next and select the desired option on the next pages and complete creating the rule set.