全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1499 2
2013-09-10
由于我使用循环语句从一张表里读取数据更新另一张表, 发现总会有其中某一个循环运行时间特别长.
排除服务器上有其他程序启动抢占资源, 因为我确认这时候只有这一个程序在运行.
下面是正常日志和时间长的日志对比, 发现page faults , page reclaims, Involuntary Context Switches 这三个后者显著要高, 有人知道是什么导致的吗, 如何解决?
1. 正常的日志:
MPRINT(AA):   data temp.ti_asc_pt_stock;
MPRINT(AA):   set temp.tm_ASC_PT_STOCK(firstobs=9300032 obs=9600032);
MPRINT(AA):   modify temp.ti_asc_pt_stock key=idx3;
MPRINT(AA):   if _iorc_ ne 0 then do;
MPRINT(AA):   output;
MPRINT(AA):   _error_=0;
MPRINT(AA):   end;
MPRINT(AA):   run;

NOTE: There were 300001 observations read from the data set TEMP.TM_ASC_PT_STOCK.
NOTE: The data set TEMP.TI_ASC_PT_STOCK has been updated.  There were 0 observations rewritten, 300001 observations added and 0
      observations deleted.
NOTE: DATA statement used (Total process time):
      real time           42.46 seconds
      user cpu time       4.09 seconds
      system cpu time     16.80 seconds
      memory              835.78k
    OS Memory           5412.00k
      Timestamp           2013- 9- 5 上午03时21分42秒
      Page Faults                       47
      Page Reclaims                     147
      Page Swaps                        0
      Voluntary Context Switches        3878
      Involuntary Context Switches      3525
      Block Input Operations            0
      Block Output Operations           0

2. 时间长的日志
MPRINT(AA):   data temp.ti_asc_pt_stock;
MPRINT(AA):   set temp.tm_ASC_PT_STOCK(firstobs=9600033 obs=9900033);
MPRINT(AA):   modify temp.ti_asc_pt_stock key=idx3;
MPRINT(AA):   if _iorc_ ne 0 then do;
MPRINT(AA):   output;
MPRINT(AA):   _error_=0;
MPRINT(AA):   end;
MPRINT(AA):   run;

NOTE: There were 300001 observations read from the data set TEMP.TM_ASC_PT_STOCK.
NOTE: The data set TEMP.TI_ASC_PT_STOCK has been updated.  There were 0 observations rewritten, 300001 observations added and 0
      observations deleted.
NOTE: DATA statement used (Total process time):
      real time           55:26.39
      user cpu time       14.36 seconds
      system cpu time     1:23.06
      memory              835.78k
      OS Memory           5412.00k
      Timestamp           2013- 9- 5 上午04时17分09秒
      Page Faults                       1545998
      Page Reclaims                     670381
      Page Swaps                        0
      Voluntary Context Switches        3940
      Involuntary Context Switches      30255
      Block Input Operations            0
      Block Output Operations           0


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-9-11 08:57:52
参考:Troubleshoot Your Performance Issues
The Page Faults statistic indicates the number of memory pages that SAS tries to access, but that are not in the
main memory and that require I/O activity. A consistently high number of page faults that occur across multiple steps
might indicate that not enough memory is available to the process. It can also mean that the application is reading a
very large sequential file without doing any serious processing, causing high (but normal) values for Page Faults.
The Page Reclaims statistic indicates the number of page faults that are serviced without any I/O activity. I/O activity
is avoided by the process of reclaiming a page frame from the list of memory pages that are awaiting reallocation.
The Page Swaps statistic indicates the number of times a process is swapped out of main memory.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-9-14 09:40:44
I notice that the memory allocation is different in two runs. The memory is an important factor in performance. Please close all other windows and run your programs to see if the difference still exists.

  
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群