[20190523]修改引數後一些細節注意.txt

lfree發表於2019-05-23

[20190523]修改引數後一些細節注意.txt

--//昨天遠端給別人解決一個小問題,就是配置使用hugepage.一些細節必須注意,透過例子說明問題.

1.環境:
# cat /proc/version
Linux version 2.6.32-220.el6.x86_64 (mockbuild@c6b18n3.bsys.dev.centos.org) (gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) ) #1 SMP Tue Dec 6 19:48:22 GMT 2011

2.配置hugepages要修改/etc/security/limits.conf,加入如下註解部分:
# grep memlock /etc/security/limits.conf
#        - memlock - max locked-in-memory address space (KB)
#*   soft  memlock  53248000
#*   hard  memlock  53248000

--//當前是沒有開啟.相當於修改配置檔案.登入oracle使用者:

$ ps -ef | grep bas[h] | grep oracl[e]
oracle   25704 25703  5 10:38 pts/0    00:00:00 -bash
--//bash程式號=25704

$ cat /proc/25704/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            10485760             unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             16384                16384                processes
Max open files            65536                65536                files
Max locked memory         65536                65536                bytes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       30408                30408                signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

--//如果你在別的視窗修改/etc/security/limits.conf:
*   soft  memlock  53248000
*   hard  memlock  53248000

--//程式號=25704配置並不會改變,也就是要退出再登入才生效,這樣情況下使用這個環境啟動資料庫肯定無法啟動.
--//在登入1個視窗:

$ ps -ef | grep bas[h] | grep oracl[e]
oracle   25704 25703  0 10:38 pts/0    00:00:00 -bash
oracle   25844 25842  7 10:42 pts/1    00:00:00 -bash

--//新增加1個視窗,程式號=25844

 $ cat /proc/25844/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            10485760             unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             16384                16384                processes
Max open files            65536                65536                files
Max locked memory         54525952000          54525952000          bytes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       30408                30408                signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

--//注意看下劃線. 54525952000/1024 = 53248000 KB.
--//也就是一些細節在工作中一定要注意.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2645262/,如需轉載,請註明出處,否則將追究法律責任。

相關文章