BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dgower
Obsidian | Level 7

I'm trying to test RTM and I need to be able to submit a job that will run for say 5 or 10 minutes so I can see how RTM is functioning while a job is running.  Does anyone know of some generic SAS code/program that can be adjusted to run for a specific number of minutes?  The option to stress the CPU and memory of the servers would be a huge plus.

 

Thanks,

 

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, there is the sleep() function:

https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm

 

Alternatively you could set a series of datasteps upd with do loops for specified number of loops.  However most of base SAS is based on CPU/memory, so changing that will change the run time.  But timing is provided, so you can see that datastep x takes y seconds in this run, and z in that run and see the difference between. 

 

View solution in original post

9 REPLIES 9
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, there is the sleep() function:

https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm

 

Alternatively you could set a series of datasteps upd with do loops for specified number of loops.  However most of base SAS is based on CPU/memory, so changing that will change the run time.  But timing is provided, so you can see that datastep x takes y seconds in this run, and z in that run and see the difference between. 

 

bdoug
Obsidian | Level 7

Submit this code.  It will run for a while and rev up the CPU!  Adjust the loop iteration counts to adjust the run time.

 

data _null_;
   do i=1 to 1000000000;
      do j=1 to 1000000000;
          k=i*j;
          l=mod(k,2499900001);
      end;
   end;
run;
dgower
Obsidian | Level 7
Excellent! Thank you. This is exactly what I needed.
dgower
Obsidian | Level 7

Despite reducing the numbers by several digits, this loop ran for 6+ hours and the CPU never spiked.

kannand
Lapis Lazuli | Level 10

While the looping code might accomplish the execution time, it might be worthwhile to note that @RW9's sleep() function might be more code efficient and CPU efficient. 

Kannan Deivasigamani
jakarman
Barite | Level 11
You can use
a/ sleep without any load on the system
b/ a cpu loop causing just cpu load
c/ a hash object or buffers with sort causing load on memory change the sizing for load on IO
d/ have a load to an external rdbms so network traffic can get loaded heavily
Tuning load balancing is also on the resource geeting the overload.
---->-- ja karman --<-----
jakarman
Barite | Level 11
Of course you will not see a spike in cpu. It is a single threaded process limited to one cpu processor.
You will have to run this at the same time by the number of expected users. It can spread every task on may of those processors. Using a multithreaded proc will show an other load
---->-- ja karman --<-----
ISedgwick
SAS Employee

Data _null_;

Endtime=time()+10*60 /* 10 MIN - change for needed duration */ ;

Do while(time() le Endtime);

/* BESPOKE CODE TO CREATE STRESS */

End;

Run;

 

There will be some cpu overhead in this job due to calling the time function several times.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 5159 views
  • 5 likes
  • 6 in conversation