HugePages for Oracle Database in Azure Cloud

Posted in: Technical Track

So, what’s up?

In case you don’t know, my co-worker Gleb Otochkin has written a couple of blog entries about HugePages’ support in different cloud providers here and here.
Given that I am preparing a presentation about HugePages, I reached out to him and asked if he has something similar in the oven for Azure, but he hasn’t. So I put my researcher hat on and initiated a simple test: create an Oracle database in an Azure instance and test if it would accept the HugePages configuration. Short story even shorter: yes, it does.

The start

It all starts with a brand new Azure account. Microsoft has been so kind as to offer an initial “Free Trial” account than includes 200€ in credits that last only 30 days, meaning that if by the end of the 30 days period you haven’t used them, you lose them. These credits are good to use in the Pay-As-You-Go subscription model to create a simple VM running the latest Azure available Red Hat Linux image which happens to be RHEL 7.2.

Unfortunately, this does not include Oracle Linux support, so we cannot use the brand new Red Hat compatible Oracle preinstallation RPM. Anyway, after some struggle in the initial account creation, I was able to quickly deploy a “Standard B2s (2 vcpus, 4 GB memory)” VM with the mentioned RHEL 7.2.

Creating the database and testing HugePages

Being this a basic RHEL image, it did not include any of the Oracle required OS configuration to deploy Oracle. Given that I don’t have an Oracle Linux license, I can’t use the brand new 18c Oracle RPM or even the basic Oracle preintallation RPM.

So, after manually configuring the OS, (I know there are Ansible workbooks for that), I chose to both install the binaries and to create a basic database with the Oracle Universal Installer for 12.2 Oracle database. Why 12.2 and not another version? To be honest, this was a quick and dirty experiment from the very beginning and this version was the first to appear in my search in Oracle Delivery.

Using the response file template included in the binaries I ran the installer and after a few minutes got both the binaries installed and the database up and running.

In case you, dear reader, are interested here it goes:

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
oracle.install.option=INSTALL_DB_AND_CONFIG
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/apps/oracle/inv
ORACLE_HOME=/apps/oracle/db_home1
ORACLE_BASE=/apps/oracle
oracle.install.db.InstallEdition=SE2
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rac.configurationType=
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.rac.serverpoolName=
oracle.install.db.rac.serverpoolCardinality=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=ORCL
oracle.install.db.config.starterdb.SID=ORCL
oracle.install.db.ConfigureAsContainerDB=false
oracle.install.db.config.PDBName=
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.memoryLimit=2048
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.password.ALL=***************
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.password.PDBADMIN=***************
oracle.install.db.config.starterdb.managementOption=DEFAULT
oracle.install.db.config.starterdb.omsHost=
oracle.install.db.config.starterdb.omsPort=
oracle.install.db.config.starterdb.emAdminUser=
oracle.install.db.config.starterdb.emAdminPassword=
oracle.install.db.config.starterdb.enableRecovery=false
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/apps/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/apps/oracle/oradata
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=TRUE
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
COLLECTOR_SUPPORTHUB_URL=

A little issue, of course

Even though everything went fine after fixing one or two parameters and installing a couple missing RPMs, when the database started, it failed to allocate the HugePages.

2018-08-20T12:31:53.072289+00:00
 Per process system memlock (soft) limit = 64K
2018-08-20T12:31:53.072378+00:00
 Expected per process system memlock (soft) limit to lock
 SHARED GLOBAL AREA (SGA) into memory: 1540M
2018-08-20T12:31:53.072469+00:00
 Available system pagesizes:
  4K, 2048K 
2018-08-20T12:31:53.072659+00:00
 Supported system pagesize(s):
2018-08-20T12:31:53.072719+00:00
  PAGESIZE  AVAILABLE_PAGES  EXPECTED_PAGES  ALLOCATED_PAGES  ERROR(s)
2018-08-20T12:31:53.072857+00:00
     2048K             1056             770               0   ORA-27125
2018-08-20T12:31:53.072922+00:00
 Reason for not supporting certain system pagesizes: 
2018-08-20T12:31:53.072983+00:00
  4K - Large pagesizes only
2018-08-20T12:31:53.073063+00:00
RECOMMENDATION:
2018-08-20T12:31:53.073103+00:00
 1. Increase per process memlock (soft) limit to at least 1540MB
 to lock 100% of SHARED GLOBAL AREA (SGA) pages into physical memory
2018-08-20T12:31:53.073187+00:00

Yes, the database failed to allocate the required HugePages due to a memlock soft limit issue. For some reason I didn’t explore, all the other soft and hard resource limits were applied successfully upon creating a new session for the ‘oracle’ user, but not this one. A quick reboot of the VM fixed this and the database came up like a charm.

The alert log shows the proper expected information regarding reserved HugePages:

2018-08-20T12:43:18.163509+00:00
Dump of system resources acquired for SHARED GLOBAL AREA (SGA)

2018-08-20T12:43:18.163653+00:00
 Per process system memlock (soft) limit = 2048M
2018-08-20T12:43:18.163821+00:00
 Expected per process system memlock (soft) limit to lock
 SHARED GLOBAL AREA (SGA) into memory: 1540M
2018-08-20T12:43:18.163952+00:00
 Available system pagesizes:
  4K, 2048K
2018-08-20T12:43:18.164143+00:00
 Supported system pagesize(s):
2018-08-20T12:43:18.164220+00:00
  PAGESIZE  AVAILABLE_PAGES  EXPECTED_PAGES  ALLOCATED_PAGES  ERROR(s)
2018-08-20T12:43:18.164382+00:00
     2048K             1056             770             770        NONE

And so does the OS meminfo:

[oracle@HPtesting ~]$ grep  ^HugePages /proc/meminfo 
HugePages_Total:    1056
HugePages_Free:      287
HugePages_Rsvd:        1
HugePages_Surp:        0

So, as my spoiler stated at the very beginning of the post, yes, we can use HugePages on Azure Cloud Red Hat Linux 7.2 virtual machines.

I hope you enjoyed this.

email
Want to talk with an expert? Schedule a call with our team to get the conversation started.

About the Author

Data Project Engineer
First of all father, then husband and finally Oracle database consultant. I love technology in general and managing data in particular. Trying to learn one new thing every day.

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *