楼主: Rad1c
1529 2

[问答] 求助:同样的程序运行时间不稳定 [推广有奖]

  • 0关注
  • 0粉丝

高中生

55%

还不是VIP/贵宾

-

威望
0
论坛币
28 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1317 点
帖子
21
精华
0
在线时间
37 小时
注册时间
2009-10-1
最后登录
2014-7-25

楼主
Rad1c 发表于 2013-9-10 15:14:23 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
由于我使用循环语句从一张表里读取数据更新另一张表, 发现总会有其中某一个循环运行时间特别长.
排除服务器上有其他程序启动抢占资源, 因为我确认这时候只有这一个程序在运行.
下面是正常日志和时间长的日志对比, 发现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


二维码

扫码加我 拉你入群

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

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

关键词:运行时间 不稳定 observations observation Operations 程序

沙发
moyunzheng 发表于 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.

藤椅
bobguy 发表于 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.

  

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-2 21:12