agorbyk

February 19, 2012

Oracle 11.2.0.3 and hugepages allocation

Filed under: hugepages — Tags: — agorbyk @ 8:36 pm

Like many other Oracle admins, I periodically fail to properly configure amount of hugepages on my Linux box and my instance silently falls back to regular 4k memory pages resulting in excessive paging/swapping.

That was in 10g and 11.1 days. Since 11.2.0.2 there is a parameter use_large_pages that controls hugepages allocation behavior. This parameter is not hidden, however there is nothing in public documentation but some notes on metalink (USE_LARGE_PAGES To Enable HugePages In 11.2 [ID 1392497.1]) and blog posts from oracle guys. This parameter can have three values and defaults to use_large_pages=true.In 11.2.0.2 default value preserves old behavior – if there are less hugepages then total allocated SGA – Oracle will write a warning message to alert.log and will go on with normal pages. With  use_large_pages=only Oracle will check during the startup if there’s enough preallocated large pages and if there isn’t – will not proceed starting up  with a message like


Specified value of sga_max_size is too small, bumping to 94220845056
****************** Large Pages Information *****************
Parameter use_large_pages = ONLY
Large Pages unused system wide = 43000 (84 GB) (alloc incr 256 MB)
Large Pages configured system wide = 43000 (84 GB) Large Page size = 2048 KB
ERROR:  Failed to allocate shared global region with large pages, unix errno = 12.
Aborting Instance startup.
ORA-27137: unable to allocate Large Pages to create a shared memory segment ACTION:  Total Shared Global Region size is 88 GB. Increase the number of  unused large pages to atleast 44932 (88 GB) to allocate 100% Shared Global  Region with Large Pages.
***********************************************************

With use_large_pages=false Oracle obviously will not use any of the large pages even if there are enough of them.

In 11.2.0.3 the default behavior has changed – now with use_large_pages=true and less then SGA hugepages Oracle will allocate part of the SGA with them and the resting part with normal 4k pages. In alert.log it will look like

Specified value of sga_max_size is too small, bumping to 94220845056
****************** Large Pages Information *****************
Total Shared Global Region in Large Pages = 84 GB (95%)
Large Pages used by this instance: 42881 (84 GB)
Large Pages unused system wide = 119 (238 MB) (alloc incr 256 MB)
Large Pages configured system wide = 43000 (84 GB) Large Page size = 2048 KB

RECOMMENDATION:  Total Shared Global Region size is 88 GB. For optimal performance,  prior to the next instance restart increase the number  of unused Large Pages by atleast 1929 2048 KB Large Pages (3858 MB)  system wide to get 100% of the Shared  Global Region allocated with Large pages
***********************************************************

So there is one trap less, but I hope Oracle will be certified for RHEL6 very soon, so we’ll have a transparent hugepages feature that will make this nice new parameter obsolete ).

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.