亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 7963 | 回復(fù): 9
打印 上一主題 下一主題

sp_monitorconfig 'procedure cache size'顯示的結(jié)果大小如何計算的? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2010-03-09 18:06 |只看該作者 |倒序瀏覽
結(jié)果如下:
1> sp_monitorconfig 'procedure cache size'
2> go
Usage information at date and time: Mar  9 2010  5:47PM.

Name                      Num_free    Num_active  Pct_act Max_Used         Num_Reuse
------------------------- ----------- ----------- ------- -----------         -----------
procedure cache size                0     4493610 100.00      4493894                   0

1> sp_configure 'procedure cache size'
2> go
Parameter Name                 Default     Memory Used Config Value         Run Value   Unit                 Type
------------------------------ ----------- ----------- ------------         ----------- -------------------- ----------
procedure cache size                  3271     1116040      512000              512000 memory pages(2k)     dynamic


我的procedure cache設(shè)置是512000*2k=1024M,這個值和monitor監(jiān)控到的Max_Used=4493894如何比較?從moinitor顯示的Num_free=0,是不是表示我的procedure cache size設(shè)置的不夠大?

還有一個問題就是我的lock大小設(shè)為500,000,而sp_monitorconfig顯示的結(jié)果如下:
1> sp_monitorconfig 'number of locks'
2> go
Usage information at date and time: Mar  9 2010  5:48PM.

Name                      Num_free    Num_active  Pct_act Max_Used         Num_Reuse
------------------------- ----------- ----------- ------- -----------         -----------
number of locks                498585        1415   0.28        95629                   0         
   
從上面是不是可以看出我設(shè)的lock已經(jīng)足夠大了,鎖設(shè)置的足夠大是不是就可以杜絕了死鎖情況的產(chǎn)生?

論壇徽章:
1
2017金雞報曉
日期:2017-01-10 15:19:56
2 [報告]
發(fā)表于 2010-03-10 09:55 |只看該作者
'number of locks' 是系統(tǒng)中同時擁有的鎖的個數(shù),但這個值的大小和是否導(dǎo)致死鎖沒有必然的關(guān)系。
關(guān)于死鎖的產(chǎn)生,主要是由于應(yīng)用使用和分配不當(dāng)造成的

論壇徽章:
0
3 [報告]
發(fā)表于 2010-03-10 12:57 |只看該作者
1)看了下monitorconfig存儲過程,把注釋搬上來。
/*
** Syntax:
**
** sp_monitorconfig "configname" [, "result_tbl_name"] [, "full"] or
** sp_monitorconfig "all" [, "result_tbl_name"] [, "full"]
**
** This stored procedure provides statistics/monitor related information
** on a configuration parameter. This data could be extracted from
** monitor counters or from other places where statistics are maintained.
**
** For example, if the config name is 'open objects', then the monitor
** information is number of open objects, number of them free, percentage
** of open objects currently being used, etc. The actual information may be
** printed in stored procedure(s) invoked from here. Other config parameters
** can be added here.
**
** Note: The server collects these resource stats by default, however,
** you can turn off the activity by boot the server with trace flag 3631.
*/
      sp_monitorconfig打印出來的使用情況應(yīng)該是從系統(tǒng)中實際統(tǒng)計得到的數(shù)據(jù);sp_configure打印的是配置值。

2) 死鎖不是dba人為可控的,這和ASE內(nèi)部的鎖機(jī)制實現(xiàn)相關(guān)。并行的transaction越多,DML操作越多,那產(chǎn)生死鎖的概率就大了,這個和事務(wù)拿鎖和放鎖的時序有關(guān)。
可以將isolation level調(diào)低,譬如設(shè)置為0,這樣就不會碰到死鎖;但是代價是讀到臟數(shù)據(jù)的可能性很大,有悖于業(yè)務(wù)的基本初衷。

論壇徽章:
0
4 [報告]
發(fā)表于 2010-03-10 14:28 |只看該作者
謝謝兩位,不過還有第一個問題誰幫手回復(fù)一下?因為之前我查sybase的調(diào)優(yōu)技術(shù)文檔,不明天他們是怎么算出來的大小,其中一段如下:

You can also determine the current size of the procedure cache with sp_monitorconfig procedure cache size. This parameter describes the amount of space in the procedure cache is currently configured for and the most it has ever actually used. For example,the procedure cache in the following server is configured for 20,000 pages:
1> sp_configure "procedure cache size"
option_name config_value run_value
------------------------------ ------------ ---------
procedure cache size 3271 3271

However, when you run sp_montorconfig “procedure cache size”, you find that the most the procedure cache has ever used is 14241 pages, which means that you can lower the run value of the procedure cache, saving memory:
1> sp_monitorconfig "procedure cache size"
Usage information at date and time: Apr 22 2002 2:49PM.
Name num_free num_active pct_act Max_Used Reused
-------------- -------- ---------- ------- -------- ------
procedure cache 5878 14122 70.61 14241 No

論壇徽章:
6
水瓶座
日期:2014-06-04 03:34:37水瓶座
日期:2014-06-17 13:20:31數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-09 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-17 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-01 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-04 06:20:00
5 [報告]
發(fā)表于 2010-03-10 14:52 |只看該作者
回復(fù) 4# sean_server


   
For example,the procedure cache in the following server is configured for 20,000 pages:
1> sp_configure "procedure cache size"
option_name config_value run_value
------------------------------ ------------ ---------
procedure cache size 3271 3271



這上面的數(shù)據(jù)不對吧,configured for 20,000 pages怎么會顯示3271。很明顯3271是默認(rèn)配置的嘛!


However, when you run sp_montorconfig “procedure cache size”, you find that the most the procedure cache has ever used is 14241 pages, which means that you can lower the run value of the procedure cache, saving memory:

然而,當(dāng)您用sp_monitorconfig存儲過程來查看“procedure cache size”的參數(shù)值時,會發(fā)現(xiàn)曾經(jīng)使用過的最大過程緩存是14241頁。這就意味著:你可以通過減少參數(shù)procedure cache size的配置值來節(jié)省內(nèi)存。

1> sp_monitorconfig "procedure cache size"
Usage information at date and time: Apr 22 2002 2:49PM.
Name num_free num_active pct_act Max_Used Reused
-------------- -------- ---------- ------- -------- ------
procedure cache 5878 14122 70.61 14241 No

num_free = 5878
num_active = 14122 這兩者加起來= 20000,就是你先前配置的值 。

Max_Used  = 14241 表示曾經(jīng)使用過的最大的過程緩存內(nèi)存量。

目前的過程緩存內(nèi)容使用率僅僅70.61%多!∧憧梢酝ㄟ^減少 procedure cache size 參數(shù)的值來減少內(nèi)存消耗。

注意以上單位為:2K。

論壇徽章:
0
6 [報告]
發(fā)表于 2010-03-10 16:00 |只看該作者
那按照你說的理解不對啊?
參照我最上面提問的數(shù)據(jù)設(shè)置,我在sp_configure配置的procedure cache size=512000*2k=1024M,但是我在sp_monitorconfig中看的num_free=0,num_active= 4493610,這個又怎么解釋呢?這兩個值也不相等啊?

論壇徽章:
6
水瓶座
日期:2014-06-04 03:34:37水瓶座
日期:2014-06-17 13:20:31數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-09 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-17 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-01 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-04 06:20:00
7 [報告]
發(fā)表于 2010-03-10 17:23 |只看該作者
不知道你看sp_monitorconfig的源碼沒有?最好自己看一下。
以前echoaix就在博客中介紹config_admin()這個系統(tǒng)函數(shù)的用法。

看sp_monitorconfig的源碼,稀里糊涂的。通過config_admin計算的就不知道如何實現(xiàn)的了。
  1. /*
  2.         ** Get the run value for the config variable
  3.         */
  4.         select @config_runval = value
  5.         from   master.dbo.syscurconfigs
  6.         where  config = @confignum

  7.         /*
  8.         ** Retrieve info for the 4 counters. Pass flag 2 as the third
  9.         ** parameter of config_admin() to get the active value
  10.         */
  11.         select @num_active = config_admin(22, @confignum, 2, 0, @counter1, NULL)

  12.         /*
  13.         ** Pass flag 3 as the third parameter of config_admin() to get
  14.         ** the max value.
  15.         */
  16.         select @max_active = config_admin(22, @confignum, 3, 0, @counter2, NULL)

復(fù)制代碼
個人總結(jié)出,config_admin()有6個參數(shù)。發(fā)現(xiàn)第一個參數(shù)有16或者22的情況。都是統(tǒng)計配置參數(shù)值的。
  1. 下面是我的研究總結(jié):
  2. 1> select name,config_admin(16,config,1000,0,null,null) from sysconfigures where  name lik
  3. e '%number of open partitions%'
  4. 2> go
  5. name



  6. -----------------------------------------------------------------------------------------
  7. ------------------------------------------------------------------------------------------
  8. ----------------------------------------------------------------------------
  9.          -----------
  10. number of open partitions


  11.                  999


  12. config_admin應(yīng)該是返回配置參數(shù)相關(guān)信息的函數(shù)。如:估計指定參數(shù)值的所耗內(nèi)存,根據(jù)內(nèi)存值估計可配置參數(shù)值大小。
  13. 還有其它未知??

  14. 如上面的例子:config_admin(16,config,1000,0,null,null)。第一個參數(shù):16的意思是估計參數(shù)值所需配置內(nèi)存大小,
  15. 或者根據(jù)內(nèi)存顯示可配置的參數(shù)大小。第二個參數(shù)為:參數(shù)數(shù)值,對應(yīng)sysconfigures.config或syscurconfigs.config。
  16. 第三個和第四個參數(shù)是相關(guān)的。如果第四個配置為:1,則第三個參數(shù)數(shù)值表示內(nèi)存值(以K為單位)。如果第四個參數(shù)配置為:0
  17. ,則第三個參數(shù)值表示配置參數(shù)值。第五、六個參數(shù)已知都配置為null。
復(fù)制代碼

論壇徽章:
6
水瓶座
日期:2014-06-04 03:34:37水瓶座
日期:2014-06-17 13:20:31數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-09 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-17 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-01 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-04 06:20:00
8 [報告]
發(fā)表于 2010-03-10 17:24 |只看該作者
個人感覺,玩這個沒什么意思!

樓主沒必要這么斤斤計較了~

論壇徽章:
0
9 [報告]
發(fā)表于 2010-03-10 19:13 |只看該作者
我的意思不是這樣的,我看你的回復(fù)的大意是,procedure cache size=num_free+num_active,而實際的情況是我配置的procedure cache size是1024M大,但是在sp_monitorconfig中看的是num_free+num_active=0+4493610=4493610;那么這個4493610和我配置的1024M是相等的嗎?

因為現(xiàn)在num_free=0,是不是表示我配的procedure cache size還不夠?

論壇徽章:
6
水瓶座
日期:2014-06-04 03:34:37水瓶座
日期:2014-06-17 13:20:31數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-09 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-07-17 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-01 06:20:00數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-08-04 06:20:00
10 [報告]
發(fā)表于 2010-03-10 20:23 |只看該作者
回復(fù) 9# sean_server


    感覺這個值4493610 不準(zhǔn)確。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP