random technical thoughts from the Nominet technical team

Starting an Oracle instance & Hugepages

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by jason on Mar 12th, 2007

Hugepages are a feature of Linux to increase the memory page size so instead of allocating memory in 4Kb blocks it gets done in 2MB chunks, other OS’s have similiar features. In theory this should enable you to have better scaling with large memory allocations. It is relatively straightforward to set up, just add an entry like the following in the /etc/sysctl.conf file:

vm.nr_hugepages = 5000

This allocates 10GB of memory to be allocated via hugepages. However to get oracle to utilise this memory, I find I have to startup a 10gR2 RAC instance using srvctl:

srvctl start instance -d DATABASE -i INSTANCE

To be clear, when starting up the RAC instance via sqlplus the memory for the instance DOES NOT get allocated from the hugepages pool, only when you startup with srvctl. The trouble starts when you are doing an upgrade, say installing a patchset, you have to startup the database with the migration option to apply the changes to the data dictionary. Except you cannot use srvctl to startup upgrade, though it does accept various options, like mount & nomount.

Be careful if you are using hugepages that if you startup your instance with just using sqlplus you may find yourself out of memory, I found I had to change the memory & the number of processes to get the instance to start for the upgrade.

7 Responses

  1. Chris Naudé Says:

    Is there a technical reason why srvctl causes Oracle to use hugepages and sqlplus does not?

  2. jason Says:

    hello,

    no, I have attempted to use strace to try and find out what difference is happening between the two but to no avail. I really wish I knew, i have also not tested this with a non-rac installation. Maybe sqlplus works for non-rac?

    jason.

  3. Andrew Finch Says:

    I have seen the same behaviour on 10g R2 RAC / Redhat 4 on Itanium. We noticed that the huge pages were not being used on this particular instance, and that excessive swapping was occuring.The huge pages could be allocated by a simple C program with a shmget call with the correct flags. We suspected perhaps a privilege problem. It may be that srvctl runs as root or has a suid root executable that can create the required shared memory area, whereas sqlplus may not call any suid executables and is run as oracle, and hence not make the required shared areas. I further suspect that the call to create the shared memory area with huge pages fails silently, and is retried without the hugepages flag. Thanks for the hint

  4. jason Says:

    well, i’m not really sure about suid as looking at srvctl executable it’s a shell script that calls some interminable java stuff.

    I also tried setting the group of hugepages shm to be the following in sysctl.conf:

    vm.hugetlb_shm_group = 2000

    this don’t seem to help!

    jason.

  5. Rich Says:

    Definitely a permissions issue - works in sqlplus as OS user oracle but not any other user.

  6. jason Says:

    hello Rich,

    Not sure about that. I have attempted to start as user oracle connected as sysdba and it does not use hugepages - only with srvctl. This is a RAC install on RedHat 4 U3. using Oracle 10.2.

    jason.

  7. Rich Says:

    64-bit 10.2.0.3 RAC on RH 4 U3 x86_64 works through SQL*Plus as OS user oracle [group dba].

    I don’t have any 32-bit installations that use hugepages…

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Recent Posts

Highest Rated

Categories

Archives

Meta: