[20190321]smem的顯示缺陷.txt
[20190321]smem的顯示缺陷.txt
1.smem 加入-m引數顯示存在缺陷,map的資訊不全:
# smem -tk -m -U oracle -P "oraclepeis|ora_"
Map PIDs AVGPSS PSS
/u01/app/oracle/product/10.2.0/db_1/dbs/ 15 0 0
[vdso] 308 0 0
[vsyscall] 308 0 0
/lib64/libaio.so.1.0.1 308 3.0K 1.1M
/lib64/libnsl-2.12.so 308 7.0K 2.1M
/lib64/ld-2.12.so 308 7.0K 2.1M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 7.0K 2.1M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 7.0K 2.1M
/lib64/libdl-2.12.so 308 7.0K 2.1M
/lib64/libnss_files-2.12.so 308 7.0K 2.2M
/lib64/libpthread-2.12.so 308 7.0K 2.2M
/lib64/libm-2.12.so 308 7.0K 2.3M
/lib64/libc-2.12.so 308 12.0K 3.7M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 14.0K 4.2M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 21.0K 6.5M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 21.0K 6.5M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 32.0K 9.7M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 56.0K 17.1M
[stack] 308 80.0K 24.1M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 103.0K 31.2M
/u01/app/oracle/product/10.2.0/db_1/bin/ 308 127.0K 38.3M
<anonymous> 308 242.0K 72.8M
[heap] 308 466.0K 140.5M
/dev/zero 308 561.0K 168.9M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 589.0K 177.4M
/u01/app/oracle/product/10.2.0/db_1/lib/ 308 1.4M 417.1M
/SYSV94f021f8 308 2.8M 876.1M
-----------------------------------------------------------------
27 8023 6.5M 2.0G
--//Map部分顯示寬度不足.可以加寬到80.很容易修改python的指令碼,我不懂python,看一下原始碼就可以了.
--//修改前注意備份!!
# diff -Nur smem.ORG smem
--- smem.ORG 2019-03-21 11:18:59.117243470 +0800
+++ smem 2013-03-28 11:01:07.000000000 +0800
@@ -330,7 +330,7 @@
pt = maptotals(p)
fields = dict(
- map=('Map', lambda n: n, '%-80.80s', len,
+ map=('Map', lambda n: n, '%-40.40s', len,
'mapping name'),
count=('Count', lambda n: pt[n]['count'], '% 5s', sum,
'number of mappings found'),
# smem.ORG -tk -m -U oracle -P "oraclepeis|ora_"
Map PIDs AVGPSS PSS
/u01/app/oracle/product/10.2.0/db_1/dbs/hc_peis.dat 15 0 0
[vdso] 151 0 0
[vsyscall] 151 0 0
/lib64/libaio.so.1.0.1 151 3.0K 588.0K
/u01/app/oracle/product/10.2.0/db_1/lib/libclsra10.so 151 7.0K 1.1M
/lib64/libnsl-2.12.so 151 7.0K 1.1M
/lib64/libnss_files-2.12.so 151 7.0K 1.1M
/u01/app/oracle/product/10.2.0/db_1/lib/libskgxn2.so 151 7.0K 1.1M
/lib64/libdl-2.12.so 151 7.0K 1.1M
/lib64/ld-2.12.so 151 7.0K 1.1M
/lib64/libpthread-2.12.so 151 7.0K 1.1M
/lib64/libm-2.12.so 151 8.0K 1.2M
/lib64/libc-2.12.so 151 14.0K 2.2M
/u01/app/oracle/product/10.2.0/db_1/lib/libdbcfg10.so 151 15.0K 2.2M
/u01/app/oracle/product/10.2.0/db_1/lib/libocrb10.so 151 22.0K 3.4M
/u01/app/oracle/product/10.2.0/db_1/lib/libskgxp10.so 151 22.0K 3.4M
/u01/app/oracle/product/10.2.0/db_1/lib/libocr10.so 151 34.0K 5.0M
/u01/app/oracle/product/10.2.0/db_1/lib/libocrutl10.so 151 61.0K 9.0M
[stack] 151 97.0K 14.4M
/u01/app/oracle/product/10.2.0/db_1/lib/libhasgen10.so 151 110.0K 16.3M
/u01/app/oracle/product/10.2.0/db_1/bin/oracle 151 222.0K 32.8M
<anonymous> 151 265.0K 39.2M
[heap] 151 488.0K 72.0M
/u01/app/oracle/product/10.2.0/db_1/lib/libnnz10.so 151 640.0K 94.4M
/dev/zero 151 950.0K 140.1M
/u01/app/oracle/product/10.2.0/db_1/lib/libjox10.so 151 1.5M 221.0M
/SYSV94f021f8 151 5.8M 880.7M
---------------------------------------------------------------------------------------------------------
27 3941 10.2M 1.5G
--//PIDS表示查詢的程式數量,它是將PSS平均分攤到各個使用者.
--//SYSV94f021f8表示共享記憶體段.
# ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x94f021f8 32768 oracle 640 1176502272 151
--//key=0x94f021f8,不過後面的PSS如果計算的不是很清楚感覺應該是1176502272/1024/1024 = 1122M.難道不過全部載入嗎?
--//nattch表示連線使用共享記憶體段的程式數.正好151可以與smem顯示的PIDS對上.不再生產系統折騰,換測試機器測試.
2.測試環境:
# smem -tk -m -U oracle -P "oraclebook|ora_"
Map PIDs AVGPSS PSS
/SYSV00000000 26 0 0
/SYSVe8a8ec10 26 0 0
/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/hc_book.dat 21 0 0
[vdso] 26 0 0
[vsyscall] 26 0 0
/lib64/libnss_dns-2.5.so 1 24.0K 24.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnque11.so 6 5.0K 30.0K
/lib64/libresolv-2.5.so 1 35.0K 35.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libclsra11.so 26 4.0K 104.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrutl11.so 26 4.0K 104.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxn2.so 26 4.0K 104.0K
/usr/lib64/libaio.so.1.0.1 26 4.0K 104.0K
/usr/lib64/libnuma.so.1 26 4.0K 104.0K
/lib64/libdl-2.5.so 26 8.0K 208.0K
/lib64/libnsl-2.5.so 26 8.0K 208.0K
/lib64/librt-2.5.so 26 8.0K 208.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libdbcfg11.so 26 8.0K 208.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnfsodm11.so 26 8.0K 208.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxp11.so 26 8.0K 208.0K
/lib64/libnss_files-2.5.so 26 8.0K 212.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrb11.so 26 9.0K 234.0K
/lib64/libpthread-2.5.so 26 9.0K 237.0K
/lib64/ld-2.5.so 26 10.0K 260.0K
/lib64/libm-2.5.so 26 12.0K 328.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocr11.so 26 14.0K 364.0K
/lib64/libc-2.5.so 26 22.0K 581.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libcell11.so 26 69.0K 1.8M
[stack] 26 82.0K 2.1M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libhasgen11.so 26 162.0K 4.1M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnnz11.so 26 231.0K 5.9M
[heap] 26 418.0K 10.6M
/dev/zero 26 793.0K 20.1M
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle 26 1.3M 35.1M
<anonymous> 26 1.6M 42.4M
---------------------------------------------------------------------------------------------------------
34 809 4.9M 126.1M
--//奇怪在共享記憶體段使用0.
# ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 349011969 oracle 640 12582912 26
0x00000000 349044738 oracle 640 633339904 26
0xe8a8ec10 349077507 oracle 640 2097152 26
3.關閉hugepages看看.
vm.nr_hugepages = 0
vm.nr_overcommit_hugepages = 0
# grep -i page /proc/meminfo
AnonPages: 249336 kB
PageTables: 18228 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
# ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 349208577 oracle 640 12582912 22
0x00000000 349241346 oracle 640 633339904 22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0xe8a8ec10 349274115 oracle 640 2097152 22
# smem -tk -m -U oracle -P "oraclebook|ora_"
Map PIDs AVGPSS PSS
/SYSVe8a8ec10 22 0 0
/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/hc_book.dat 20 0 0
[vdso] 22 0 0
[vsyscall] 22 0 0
/lib64/libnss_dns-2.5.so 1 24.0K 24.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnque11.so 4 6.0K 24.0K
/lib64/libresolv-2.5.so 1 35.0K 35.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libclsra11.so 22 4.0K 88.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrutl11.so 22 4.0K 88.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxn2.so 22 4.0K 88.0K
/usr/lib64/libaio.so.1.0.1 22 4.0K 88.0K
/usr/lib64/libnuma.so.1 22 4.0K 88.0K
/lib64/libdl-2.5.so 22 8.0K 176.0K
/lib64/libnsl-2.5.so 22 8.0K 176.0K
/lib64/librt-2.5.so 22 8.0K 176.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libdbcfg11.so 22 8.0K 176.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnfsodm11.so 22 8.0K 176.0K
/lib64/libnss_files-2.5.so 22 8.0K 179.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrb11.so 22 9.0K 198.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxp11.so 22 9.0K 198.0K
/lib64/libpthread-2.5.so 22 9.0K 200.0K
/lib64/ld-2.5.so 22 10.0K 220.0K
/lib64/libm-2.5.so 22 12.0K 281.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocr11.so 22 14.0K 308.0K
/lib64/libc-2.5.so 22 22.0K 492.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libcell11.so 22 70.0K 1.5M
[stack] 22 73.0K 1.6M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libhasgen11.so 22 166.0K 3.6M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnnz11.so 22 232.0K 5.0M
[heap] 22 420.0K 9.0M
/dev/zero 22 572.0K 12.3M
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle 22 1.6M 34.4M
<anonymous> 22 1.8M 38.6M
/SYSV00000000 22 4.0M 88.6M
---------------------------------------------------------------------------------------------------------
34 686 9.1M 198.0M
--///SYSV00000000那行PSS=88.6M.
SYS@book> select /*+ full(A) */ count(*) from sh.sales a;
COUNT(*)
----------
918843
[root@gxqyydg4 IP=100.78 /etc ] # smem -tk -m -U oracle -P "oraclebook|ora_"
Map PIDs AVGPSS PSS
/SYSVe8a8ec10 22 0 0
/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/hc_book.dat 20 0 0
[vdso] 22 0 0
[vsyscall] 22 0 0
/lib64/libnss_dns-2.5.so 1 24.0K 24.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnque11.so 4 6.0K 24.0K
/lib64/libresolv-2.5.so 1 35.0K 35.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libclsra11.so 22 4.0K 88.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrutl11.so 22 4.0K 88.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxn2.so 22 4.0K 88.0K
/usr/lib64/libaio.so.1.0.1 22 4.0K 88.0K
/usr/lib64/libnuma.so.1 22 4.0K 88.0K
/lib64/libdl-2.5.so 22 8.0K 176.0K
/lib64/libnsl-2.5.so 22 8.0K 176.0K
/lib64/librt-2.5.so 22 8.0K 176.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libdbcfg11.so 22 8.0K 176.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnfsodm11.so 22 8.0K 176.0K
/lib64/libnss_files-2.5.so 22 8.0K 179.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrb11.so 22 9.0K 198.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxp11.so 22 9.0K 198.0K
/lib64/libpthread-2.5.so 22 9.0K 200.0K
/lib64/ld-2.5.so 22 10.0K 220.0K
/lib64/libm-2.5.so 22 12.0K 282.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocr11.so 22 14.0K 308.0K
/lib64/libc-2.5.so 22 22.0K 492.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libcell11.so 22 70.0K 1.5M
[stack] 22 76.0K 1.6M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libhasgen11.so 22 166.0K 3.6M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnnz11.so 22 232.0K 5.0M
[heap] 22 420.0K 9.0M
/dev/zero 22 642.0K 13.8M
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle 22 1.6M 35.0M
<anonymous> 22 1.8M 38.7M
/SYSV00000000 24 6.0M 143.7M
---------------------------------------------------------------------------------------------------------
34 747 11.0M 262.4M
--///SYSV00000000那行PSS=143.7M.說明共享記憶體的分配可以動態變化.
4.關閉hugepages以及設定引數pre_page_sga=true:
# smem -tk -m -U oracle -P "oraclebook|ora_"
Map PIDs AVGPSS PSS
/SYSVe8a8ec10 22 0 0
/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/hc_book.dat 20 0 0
[vdso] 22 0 0
[vsyscall] 22 0 0
/lib64/libnss_dns-2.5.so 1 24.0K 24.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnque11.so 4 6.0K 24.0K
/lib64/libresolv-2.5.so 1 35.0K 35.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libclsra11.so 22 4.0K 88.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrutl11.so 22 4.0K 88.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxn2.so 22 4.0K 88.0K
/usr/lib64/libaio.so.1.0.1 22 4.0K 88.0K
/usr/lib64/libnuma.so.1 22 4.0K 88.0K
/lib64/libdl-2.5.so 22 8.0K 176.0K
/lib64/libnsl-2.5.so 22 8.0K 176.0K
/lib64/librt-2.5.so 22 8.0K 176.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libdbcfg11.so 22 8.0K 176.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnfsodm11.so 22 8.0K 176.0K
/lib64/libnss_files-2.5.so 22 8.0K 179.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrb11.so 22 9.0K 198.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxp11.so 22 9.0K 198.0K
/lib64/libpthread-2.5.so 22 9.0K 200.0K
/lib64/ld-2.5.so 22 10.0K 220.0K
/lib64/libm-2.5.so 22 12.0K 281.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocr11.so 22 14.0K 308.0K
/lib64/libc-2.5.so 22 22.0K 492.0K
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libcell11.so 22 70.0K 1.5M
[stack] 22 72.0K 1.5M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libhasgen11.so 22 166.0K 3.6M
/u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnnz11.so 22 232.0K 5.0M
[heap] 22 420.0K 9.0M
/dev/zero 22 589.0K 12.7M
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle 22 1.6M 34.4M
<anonymous> 22 1.8M 38.6M
/SYSV00000000 22 27.8M 611.5M
---------------------------------------------------------------------------------------------------------
34 686 32.8M 721.2M
--//設定pre_page_sga=true,表示啟動資料庫全部載入整個SGA到記憶體.
--//633339904/1024/1024 = 604M
--//其實這樣後面的PSS記憶體總和基本表示這個例項使用的記憶體量.
--//看看官方的定義:
PRE_PAGE_SGA determines whether Oracle reads the entire SGA into memory at instance startup. Operating system page table
entries are then prebuilt for each page of the SGA. This setting can increase the amount of time necessary for instance
startup, but it is likely to decrease the amount of time necessary for Oracle to reach its full performance capacity
after startup.
--//我看了幾臺機器,使用hugepages,map對應是共享記憶體段的都是0,對於這些不熟悉.^_^.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2638970/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20231207]ls -f的顯示問題.txt
- [20190202]使用smem查詢oracle記憶體使用.txtOracle記憶體
- [20211020]奇怪lsnrctl status顯示.txt
- [20180811]windows 7 顯示桌面.txtWindows
- 研究顯示,用Python更易出現軟體缺陷!Python
- [20230405]奇怪的顯示輸出寬度.txt
- [20201103]lsof顯示link=0的檔案.txt
- smem的學習
- [20210301]延遲顯示輸出.txt
- [20190412]bash顯示日期相減.txt
- [20180628]顯示bbed x命令格式.txt
- [20190321]測試相同語句遇到導致cursor pin S的疑問.txt
- [20190320]關於使用smem檢視記憶體使用的問題.txt記憶體
- [20181207]sqlplus下顯示資料精度.txtSQL
- [20180312]iostat顯示輸出問題.txtiOS
- [20230906]顯示最近統計分析的操作報表.txt
- [20200217]bash顯示path環境變數.txt變數
- [20201121]顯示時間戳高精度版本.txt時間戳
- [20220317]補充完善TPT 顯示欄位列的指令碼.txt指令碼
- [20230501]為什麼沒有顯示輸出.txt
- [20220826]顯示alert日誌檔案全路徑.txt
- [20211108]sqlplus資料寬度顯示設定.txtSQL
- [20191104]sqlplus下顯示資料精度2.txtSQL
- [20190502]給顯示輸出加入時間戳.txt時間戳
- [20220826]ls顯示檔案不區分大小寫.txt
- [20190720]12cR2顯示執行計劃.txt
- [20200313]windows顯示輸出時間戳指令碼.txtWindows時間戳指令碼
- [20181107]18c set feedback顯示sql_id.txtSQL
- [20200824]12c sqlplus rowprefetch arraysize 顯示行數量的關係.txtSQL
- 獨立顯示卡與整合顯示卡的區別 獨立顯示卡與整合顯示卡哪個更好
- 電腦TXT檔案怎麼顯示行數? 電腦TXT檔案行數檢視方法
- 獨立顯示卡與整合顯示卡的區別 獨立顯示卡與整合顯示卡優缺點介紹
- gtx和rtx顯示卡的區別 gtx顯示卡和rtx顯示卡哪個好
- CAD中能顯示列印不顯示
- [20181006]12c sqlplus顯示使用者上次登入時間.txtSQL
- 專業顯示卡和遊戲顯示卡的區別詳解 專業顯示卡和遊戲顯示卡哪個好?遊戲
- uboot顯示logo的方式bootGo
- unity 分數的顯示Unity