
{"id":543,"date":"2018-10-12T17:44:07","date_gmt":"2018-10-12T20:44:07","guid":{"rendered":"http:\/\/rodrigosilvaesilva.com.br\/?p=543"},"modified":"2018-10-12T17:44:07","modified_gmt":"2018-10-12T20:44:07","slug":"hugepages","status":"publish","type":"post","link":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/2018\/10\/12\/hugepages\/","title":{"rendered":"Script hugepages"},"content":{"rendered":"<p><a href=\"http:\/\/152.67.63.124\/wp-content\/uploads\/2018\/10\/hugepages_settings.zip\">Download<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Segue o script hugepages<\/p>\n<pre class=\"lang:plsql decode:true\">#!\/bin\/bash\n#\n# hugepages_settings.sh\n#\n# Linux bash script to compute values for the\n# recommended HugePages\/HugeTLB configuration\n# on Oracle Linux\n#\n# Note: This script does calculation for all shared memory\n# segments available when the script is run, no matter it\n# is an Oracle RDBMS shared memory segment or not.\n#\n# This script is provided by Doc ID 401749.1 from My Oracle Support \n# http:\/\/support.oracle.com\n\n# Welcome text\necho \"\nThis script is provided by Doc ID 401749.1 from My Oracle Support \n(http:\/\/support.oracle.com) where it is intended to compute values for \nthe recommended HugePages\/HugeTLB configuration for the current shared \nmemory segments on Oracle Linux. Before proceeding with the execution please note following:\n * For ASM instance, it needs to configure ASMM instead of AMM.\n * The 'pga_aggregate_target' is outside the SGA and \n   you should accommodate this while calculating SGA size.\n * In case you changes the DB SGA size, \n   as the new SGA will not fit in the previous HugePages configuration, \n   it had better disable the whole HugePages, \n   start the DB with new SGA size and run the script again.\nAnd make sure that:\n * Oracle Database instance(s) are up and running\n * Oracle Database 11g Automatic Memory Management (AMM) is not setup \n   (See Doc ID 749851.1)\n * The shared memory segments can be listed by command:\n     # ipcs -m\n\n\nPress Enter to proceed...\"\n\nread\n\n# Check for the kernel version\nKERN=`uname -r | awk -F. '{ printf(\"%d.%d\\n\",$1,$2); }'`\n\n# Find out the HugePage size\nHPG_SZ=`grep Hugepagesize \/proc\/meminfo | awk '{print $2}'`\nif [ -z \"$HPG_SZ\" ];then\n    echo \"The hugepages may not be supported in the system where the script is being executed.\"\n    exit 1\nfi\n\n# Initialize the counter\nNUM_PG=0\n\n# Cumulative number of pages required to handle the running shared memory segments\nfor SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep \"[0-9][0-9]*\"`\ndo\n    MIN_PG=`echo \"$SEG_BYTES\/($HPG_SZ*1024)\" | bc -q`\n    if [ $MIN_PG -gt 0 ]; then\n        NUM_PG=`echo \"$NUM_PG+$MIN_PG+1\" | bc -q`\n    fi\ndone\n\nRES_BYTES=`echo \"$NUM_PG * $HPG_SZ * 1024\" | bc -q`\n\n# An SGA less than 100MB does not make sense\n# Bail out if that is the case\nif [ $RES_BYTES -lt 100000000 ]; then\n    echo \"***********\"\n    echo \"** ERROR **\"\n    echo \"***********\"\n    echo \"Sorry! There are not enough total of shared memory segments allocated for \nHugePages configuration. HugePages can only be used for shared memory segments \nthat you can list by command:\n\n    # ipcs -m\n\nof a size that can match an Oracle Database SGA. Please make sure that:\n * Oracle Database instance is up and running \n * Oracle Database 11g Automatic Memory Management (AMM) is not configured\"\n    exit 1\nfi\n\n# Finish with results\ncase $KERN in\n    '2.2') echo \"Kernel version $KERN is not supported. Exiting.\" ;;\n    '2.4') HUGETLB_POOL=`echo \"$NUM_PG*$HPG_SZ\/1024\" | bc -q`;\n           echo \"Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL\" ;;\n    '2.6') echo \"Recommended setting: vm.nr_hugepages = $NUM_PG\" ;;\n    '3.8') echo \"Recommended setting: vm.nr_hugepages = $NUM_PG\" ;;\n    '3.10') echo \"Recommended setting: vm.nr_hugepages = $NUM_PG\" ;;\n    '4.1') echo \"Recommended setting: vm.nr_hugepages = $NUM_PG\" ;;\nesac\n\n# En\n<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/support.oracle.com\/epmos\/faces\/DocumentDisplay?_afrLoop=566515340132382&amp;parent=orachkReport&amp;sourceId=+DATABASE&amp;id=401749.1&amp;_afrWindowMode=0&amp;_adf.ctrl-state=1aqworfv7z_4#CODE\">Fonte Oracle Support<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Download &nbsp; Segue o script hugepages #!\/bin\/bash # # hugepages_settings.sh # # Linux bash script to compute values for the # recommended HugePages\/HugeTLB configuration # on Oracle Linux # # Note: This script does calculation for all shared memory # segments available when the script is run, no matter it # is an Oracle RDBMS&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[151],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-hugepages"],"_links":{"self":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=543"}],"version-history":[{"count":0,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts\/543\/revisions"}],"wp:attachment":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}