Thread execution time problem
Hi everyone.
I�m developing an application that creates multiple threads, does certain calculations, and runs a couple programs.
The problem is: for some reason, the time that takes to run each thread tends to increment as the number of threads increments.
That is, for 2 threads the time is x for 4 is x + n, and so on.
I�d checked that every thread is doing the same (with few differences that not influences in a reasonable fashion), and that, skipping the external programs execution, the problem doesn�t exist. Moreover, there are no inter thread communication.
My questions: there is any way in which I can reduce the amount of time?
There is some reason for the amount of time the external process called takes to run to increment? (I checked that if I not call those programs the amount of time each thread takes to execute is near 0 millisecs).
Something like Windows limits the use of a program multiple times, or something like that.(yes i have only tested it in Windows environment, and yes, the external programs i use are posix compliant)
The actually time is about 120 secs., and I have to cut it to, at least, aprox. 40.
A thread alone can run in less than 30 secs., in the worst case.
Thanks in advance.
Now imagine that most of the tasks involve fetching
something from the refrigerator. Even if you have
multiple chefs in the kitchen, they will, unless
scheduled properly, all be contending to open the
door and reach inside.I think that could be the case. All the threads are trying to execute the same archive. As far as I remember, a file isn't locked if it is accessed for reading (or executing) only, but, on the other hand, you're right, there is only one refrigerator on this kitchen, and too many chefs.
Something else attracted my attention about this. When I run my project, there are two things that grow considerably: first the CPU's usage, and second, the amount of memory each of the external process called by my program consumes I think this could be related with my problem.
Again: I ran my project commenting the calls to Runtime.exec(�command�) and the time dropped significantly. Running normally, the threads tend to increment their time of execution. Lets say the first thread takes to execute X seconds, the nth thread will take X plus M. In the test I ran, the first thread lived for 30 seconds and the last (150th) lived for about 130 seconds. Without the calls to Runtime.exec() the first threads lived for 0 milliseconds and the last(150th) lived for 6 milliseconds. Therefore, the CPU�s overhead for everything else isn�t the problem here, I think.
I tried something else to discard the problem of the file access:
I created ten copies of the ping program in a directory other than the system default, and called them �ping1�, �ping2�, and so on.
Then, I created a program that creates some threads and executes a ping through a call to the program pingN (with Runtime.exec(), again), so each thread will access a different file (the first thread access ping1, the second ping2 �), and so, the bottle neck problem on the file system shouldn�t happen. But that hasn�t changed anything. With the calls to Runtime.exec() the execution time goes to the clouds, and without it, it�s near zero. And neither is fault of the ping, the I set the timeout to 3 seconds and the retries to 4, so the max amount of time it�ll take to execute is about 12 seconds, but it takes 40+-
Similar Messages
-
Process and thread execution time
HI all
I am doing a project to develop a high level simulation framework. In the project I need to calculate the number of cycles of a snippet of code in a thread. Like
void func()
event1():
int x;
x = x * x;
for();
while();
exec(numberofcyles)
event2();
Here I want to calculate the number of cycles between event1 and event2 and pass these number of cycles to the exec(numberofcycles) which will later on be simulated. I investigated a number of tools like gprof, Dtrace, linux process statistics, rdstc, getrusage(). None of these seems to be very relevent.
I tried linux process statistics i.e. /proc/<pid>/task/<tid>/stat. I can access the execution time of threads, but all the time I get 0 execution time. What I think that it reads the execution time of threads when it was started. Is there any way to get the updated execution time of thread?
Any help will be highly appreciated.
IrfanI suggest reposting in the Unix forum here:
http://discussions.apple.com/forum.jspa?forumID=735 -
I have a logic that creates an XML by iterating through a collection of objects (which in turn has many child collections). When the number of collection becomes more it actually takes too long time to complete the xml generation. So i decided to go for threaded design where i create a thread for each parent collection. For e.g. earlier if i had 10 parent collections it would take 60 secs (6 secs for each). Now after my threaded design i expected it to be at 6 secs for all the 10 collections as all 10 collections are executed parallely. But to my surprise it didn't give me much time difference. It was almost the same time (reduced a little time). Iam wondering what could be wrong?. After creating all my threads say 10 threads for 10 collections iam using JOIN to connect all of them. Any inputs would be greatly appreciated.
TIA.
Balachandar.It will take the same time since the same amount of work needs to be done regardless of the number of threads used! Unless you have a lot of processors in your system then threads only 'seem' to run concurrently. Even with a multiprocessor system you need a JVM which would take advantage of the extra processors to see any speed increase.
-
Execution time of transactions
Hi,
I'm a bit confused about a the execution time of transactions in a transaction.
I just wrote a transaction which calls four other transactions (just for time testing) and I get the following result:
[INFO ]: Execution Started At: 09:11:37
[INFO ]: Execution Started At: 09:11:37
[INFO ]: Execution Completed At: 09:11:37 Elapsed Time was 453 mS
[INFO ]: Execution Started At: 09:11:38
[INFO ]: Execution Completed At: 09:11:38 Elapsed Time was 31 mS
[INFO ]: Execution Started At: 09:11:38
[INFO ]: Execution Completed At: 09:11:38 Elapsed Time was 109 mS
[INFO ]: Execution Started At: 09:11:38
[INFO ]: Execution Completed At: 09:11:38 Elapsed Time was 125 mS
[INFO ]: Execution Completed At: 09:11:38 Elapsed Time was 1547 mS
the first 4 time information are from the calles transaction. The last time information is from the "outer" transaction.
But I just call the 4 transactions and don't do anything else. Why is there such a big time difference? (more then double of time) And how can I solve this problem?
Thanks
MatthiasJeremy,
If the box is checked and you only call the TRX action once in your logic flow I don't think it really makes any difference because the runner servlet has to load/parse the file at least once no matter what.
Do you mean it doesn't make any differences generally or I performance?
As the "log" shows there is a difference. Even in my original transaktion I feel that it is really faster. But the general results are the same. So I get the same results faster
Just to be sure: The outer transaction and the transaction will be loaded everytime it is called by a user, webservice or what ever. So if the the transaction is startet twice a the same second in different threads they were also loaded twice?
And another question: I don't think it is possible to start a new thread in a transaction, is it? Why I'm asking: In my transaction I have some action that shuld be executed immediately and other action that can be done at a later time. (Some updates / inserts in tables and they aren't critical if they fail). So best solution on performance point of view would be if the main thread runs fast and the User gets the result and all other things run after this. Do I have any chance to do so or is something like this planed in future versions of MII?
I mark this question as answered as my originaly question is answered.
Thank you.
Regards,
Matthias -
Hi all,
I am using the Timer class provided with JDK1.4. During scheduling, you take the current time as the reference time for relative timer. Everything is ok if i dont change the system time.
But consider this scenario. If i have a heartbeat timer (which dont worries about the current time) which ticks every 500 milliseconds ( after some 5 to 6 ticks I am disconnecting from the server) but when I change the system time, the heartbeat will tick many number of times depending on the changed time assuming that timout is happened and get disconnected with the server.
How can I solve this? If it can't be done with jdk timer, please help in identifying a solution for this?
TIA
KarthikIn response to cpolizzi: (Not in original posting order)
One reason that I do not like the
javax.swing.Timer is that it requires a
graphical subsystem to be present.One would expect that from a javax.swing class, yes. Swing is a graphical toolkit.
Digressing slightly, note that since Java 1.4, the AWT no longer needs a graphical subsystem to be present, so image manipulation (and such) is now possible on headless J2EE servers.
The Java application created and started both J2SE
supplied timers each for a one minute delay as well as
two other threads. One thread does a
Thread.sleep for one minute and the other
thread does an Object.wait with a timeout for
one minute on a locally created object to synchronize
on. After the two timers and threads were started,
which I tried to start as close as possible, the main
application thread also does a Thread.sleep for
one minute. After the main application thread went to
sleep, I changed the system clock back by one minute.
The results: the two threads doing a
Thread.sleep and Object.wait "woke" back
up after one minute even despite the change in the
system clock as did the main application thread also
doing a Thread.sleep. However, the two J2SE
supplied timers did not. Instead, each of those
timers "expired" when the system clock reached one
minute after the time in which each one was scheduled
or started. I encountered this behavior on both of
the JVM's I have loaded on my W2K box.This is 100% correct behaviour, exactly as I would expect.
I also tried setting the system clock ahead by 30
seconds, one minute and even five minutes after
everything is going and it seems that the J2SE timers
were not affected - each expired right when other
threads resumed from their sleep and wait. I
encountered this behavior on both of the JVM's I have
loaded on my W2K box.Once again, this behaviour is as close to correct as is reasonably possible.
Without delving into the implementation into either
one of the J2SE supplied timers, it seems to me that
both of these timers, when they are effectively
started ticking, calculate the expected expiration
time relative to the current system time and use a
polling mechanism on seperate threads.Perhaps you should have delved.
java.util.Timer works on a priority queue of tasks. It will wait (using Object.wait()) for the time period required for the next task to expire, and then test if the task has indeed expired, through a comparison to System.currentTimeMillis(). If it hasn't, presumably because of spurious wakeup, it will again wait until it expects the task to expire and retest. Exceptions to this flow may occur if the task queue changes - if a task is scheduled or rescheduled, so the expected closest expiry time is closer than the current waiting time, then the wait will be interrupted and recalculated. If the next task is unscheduled, then the wait will be interrupted and recalculated for the next task in line.
Thus, if you move the system time back, then the timer will indeed wait until the Task's scheduled expiry date/time has been reached... if you move the system time forward, then when the timer wakes up from its wait, it will realise that the task has indeed expired and it will fire as expected, unless it is deemed too late to fire.
To summarise, java.util.Timer is an optimal implementation of a single-threaded event scheduler for events scheduled to execute at a particular time in the future, marked by a given date and time. See below for comments on spurious wakeup for why this is so.
My bottom line expectation is that when it comes to
relative timers, a duration is a duration regardless
of what happens to the system's notion of current
time.You will note that java.util.Timer offers a cron-like facility for tasks to be performed at set times during the day. It can also be used to perform tasks at set time intervals, but such behaviour requires a constant and predictable system time.
You should further note that changing the system time will not prevent a task executing, unless the system time has been moved later than the allowable execution time for a particular task - which is exactly defined in the documentation, and the most correct behaviour that could be reasonably expected.
Aside from the fact that I find this behavior of the
supplied J2SE timers unacceptable, that is if the
synopsis is correct, I need to find a way around this
problem. The only reasonable course of action that I
have is to implement my own timers. Fortunately, the
impact to any dependent code at work will be isolated
since I have already abstracted the J2SE timer
dependencies from the clients.This is correct. If you want custom, specific behaviour in a context that provided system classes do not cater for, then you will need to either find an alternate implementation or build your own.
Digressing again, all waits should be performed in a while loop to prevent against spurious thread wakeup. The wait condition should hold the definitive break condition for the wait loop... in the case of an accurate timer, the break condition is that the required number of milliseconds have passed since the wait was entered. I challenge you to implement an accurate timer that is not dependent on the system time and is protected against spurious wakeup.
Spurious wakeup is not just theoretical - I have actually had to rework a non-protected wait() providing a simple delay into a time-dependent looping wait because I was experiencing consistent spurious wakeup in a particular circumstance. I still don't know what the circumstance was exactly, but double-checking against the system time meant I didn't have to (Incidentally, the spurious wakeup didn't recur, so the system was not ever reduced to polling)
As for the java.util.Timer, each timer has its
own queue which runs on a seperate VM thread. So, if
I go and create thousands of timers (ala new
java.util.Timer()) I get thousands of VM threads.Why would you expect any different? java.util.Timer supports arbitrarily many tasks being scheduled at any particular time (Subject to restrictions as mentioned in the java.util.Timer javadoc documentation), so only one Timer object needs to be created. More than one may be created, so distinct subsystems of a framework can execute completely distinct timers (ie- one subsystem's timer failing for any reason won't bring the other subsystems' timers down). If you dislike such flexibility, feel free to devise your own interface. -
Loading jar files at execution time via URLClassLoader
Hello�All,
I'm�making�a�Java�SQL�Client.�I�have�practicaly�all�basic�work�done,�now�I'm�trying�to�improve�it.
One�thing�I�want�it�to�do�is�to�allow�the�user�to�specify�new�drivers�and�to�use�them�to�make�new�connections.�To�do�this�I�have�this�class:�
public�class�DriverFinder�extends�URLClassLoader{
����private�JarFile�jarFile�=�null;
����
����private�Vector�drivers�=�new�Vector();
����
����public�DriverFinder(String�jarName)�throws�Exception{
��������super(new�URL[]{�new�URL("jar",�"",�"file:"�+�new�File(jarName).getAbsolutePath()�+"!/")�},�ClassLoader.getSystemClassLoader());
��������jarFile�=�new�JarFile(new�File(jarName));
��������
��������/*
��������System.out.println("-->"�+�System.getProperty("java.class.path"));
��������System.setProperty("java.class.path",�System.getProperty("java.class.path")+File.pathSeparator+jarName);
��������System.out.println("-->"�+�System.getProperty("java.class.path"));
��������*/
��������
��������Enumeration�enumeration�=�jarFile.entries();
��������while(enumeration.hasMoreElements()){
������������String�className�=�((ZipEntry)enumeration.nextElement()).getName();
������������if(className.endsWith(".class")){
����������������className�=�className.substring(0,�className.length()-6);
����������������if(className.indexOf("Driver")!=-1)System.out.println(className);
����������������
����������������try{
��������������������Class�classe�=�loadClass(className,�true);
��������������������Class[]�interfaces�=�classe.getInterfaces();
��������������������for(int�i=0;�i<interfaces.length;�i++){
������������������������if(interfaces.getName().equals("java.sql.Driver")){
����������������������������drivers.add(classe);
������������������������}
��������������������}
��������������������Class�superclasse�=�classe.getSuperclass();
��������������������interfaces�=�superclasse.getInterfaces();
��������������������for(int�i=0;�i<interfaces.length;�i++){
������������������������if(interfaces[i].getName().equals("java.sql.Driver")){
����������������������������drivers.add(classe);
������������������������}
��������������������}
����������������}catch(NoClassDefFoundError�e){
����������������}catch(Exception�e){}
������������}
��������}
����}
����
����public�Enumeration�getDrivers(){
��������return�drivers.elements();
����}
����
����public�String�getJarFileName(){
��������return�jarFile.getName();
����}
����
����public�static�void�main(String[]�args)�throws�Exception{
��������DriverFinder�df�=�new�DriverFinder("D:/Classes/db2java.zip");
��������System.out.println("jar:�"�+�df.getJarFileName());
��������Enumeration�enumeration�=�df.getDrivers();
��������while(enumeration.hasMoreElements()){
������������Class�classe�=�(Class)enumeration.nextElement();
������������System.out.println(classe.getName());
��������}
����}
It�loads�a�jar�and�searches�it�looking�for�drivers�(classes�implementing�directly�or�indirectly�interface�java.sql.Driver)�At�the�end�of�the�execution�I�have�found�all�drivers�in�the�jar�file.
The�main�application�loads�jar�files�from�an�XML�file�and�instantiates�one�DriverFinder�for�each�jar�file.�The�problem�is�at�execution�time,�it�finds�the�drivers�and�i�think�loads�it�by�issuing�this�statement�(Class�classe�=�loadClass(className,�true);),�but�what�i�think�is�not�what�is�happening...�the�execution�of�my�code�throws�this�exception
java.lang.ClassNotFoundException:�com.ibm.as400.access.AS400JDBCDriver
��������at�java.net.URLClassLoader$1.run(URLClassLoader.java:198)
��������at�java.security.AccessController.doPrivileged(Native�Method)
��������at�java.net.URLClassLoader.findClass(URLClassLoader.java:186)
��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:299)
��������at�sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:255)
��������at�java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
��������at�java.lang.Class.forName0(Native�Method)
��������at�java.lang.Class.forName(Class.java:140)
��������at�com.marmots.database.DB.<init>(DB.java:44)
��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
��������at�com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
��������at�com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
Driver�file�is�not�in�the�classpath�!!!�
I�have�tried�also�(as�you�can�see�in�comented�lines)�to�update�System�property�java.class.path�by�adding�the�path�to�the�jar�but�neither...
I'm�sure�I'm�making�a/some�mistake/s...�can�you�help�me?
Thanks�in�advice,
(if�there�is�some�incorrect�word�or�expression�excuse�me)Sorry i have tried to format the code, but it has changed to �... sorry read this one...
Hello All,
I'm making a Java SQL Client. I have practicaly all basic work done, now I'm trying to improve it.
One thing I want it to do is to allow the user to specify new drivers and to use them to make new connections. To do this I have this class:
public class DriverFinder extends URLClassLoader{
private JarFile jarFile = null;
private Vector drivers = new Vector();
public DriverFinder(String jarName) throws Exception{
super(new URL[]{ new URL("jar", "", "file:" + new File(jarName).getAbsolutePath() +"!/") }, ClassLoader.getSystemClassLoader());
jarFile = new JarFile(new File(jarName));
System.out.println("-->" + System.getProperty("java.class.path"));
System.setProperty("java.class.path", System.getProperty("java.class.path")+File.pathSeparator+jarName);
System.out.println("-->" + System.getProperty("java.class.path"));
Enumeration enumeration = jarFile.entries();
while(enumeration.hasMoreElements()){
String className = ((ZipEntry)enumeration.nextElement()).getName();
if(className.endsWith(".class")){
className = className.substring(0, className.length()-6);
if(className.indexOf("Driver")!=-1)System.out.println(className);
try{
Class classe = loadClass(className, true);
Class[] interfaces = classe.getInterfaces();
for(int i=0; i<interfaces.length; i++){
if(interfaces.getName().equals("java.sql.Driver")){
drivers.add(classe);
Class superclasse = classe.getSuperclass();
interfaces = superclasse.getInterfaces();
for(int i=0; i<interfaces.length; i++){
if(interfaces[i].getName().equals("java.sql.Driver")){
drivers.add(classe);
}catch(NoClassDefFoundError e){
}catch(Exception e){}
public Enumeration getDrivers(){
return drivers.elements();
public String getJarFileName(){
return jarFile.getName();
public static void main(String[] args) throws Exception{
DriverFinder df = new DriverFinder("D:/Classes/db2java.zip");
System.out.println("jar: " + df.getJarFileName());
Enumeration enumeration = df.getDrivers();
while(enumeration.hasMoreElements()){
Class classe = (Class)enumeration.nextElement();
System.out.println(classe.getName());
It loads a jar and searches it looking for drivers (classes implementing directly or indirectly interface java.sql.Driver) At the end of the execution I have found all drivers in the jar file.
The main application loads jar files from an XML file and instantiates one DriverFinder for each jar file. The problem is at execution time, it finds the drivers and i think loads it by issuing this statement (Class classe = loadClass(className, true);), but what i think is not what is happening... the execution of my code throws this exception
java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at com.marmots.database.DB.<init>(DB.java:44)
at com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
at com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
at com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
at com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
Driver file is not in the classpath !!!
I have tried also (as you can see in comented lines) to update System property java.class.path by adding the path to the jar but neither...
I'm sure I'm making a/some mistake/s... can you help me?
Thanks in advice,
(if there is some incorrect word or expression excuse me) -
How to get the execution time of a Discoverer Report from qpp_stats table
Hello
by reading some threads on this forum I became aware of the information stored in eul5_qpp_stats table. I would like to know if I can use this table to determine the execution time of a worksheet. In particular it looks like the field qs_act_elap_time stores the actual elapsed time of each execution of specific worksheet: am I correct? If so, how is this value computed? What's the unit of measure? I assume it's seconds, but then I've seen that sometimes I get numbers with decimals.
For example I ran a worksheet and it took more than an hour to run, and the value I get in the qs_act_elap_time column is 2218.313.
Assuming the unit of measure was seconds than it would mean approx 37 mins. Is that the actual execution time of the query on the database? I guess the actual execution time on my Discoverer client was longer since some calculations were performed at the client level and not on the database.
I would really appreciate if you could shed some light on this topic.
Thanks and regards
GiovanniThanks a lot Rod for your prompt reply.
I agree with you about the accuracy of the data. Are you aware of any other way to track the execution times of Discoverer reports?
Thanks
Giovanni -
Same sqlID with different execution plan and Elapsed Time (s), Executions time
Hello All,
The AWR reports for two days with same sqlID with different execution plan and Elapsed Time (s), Executions time please help me to find out what is reason for this change.
Please find the below detail 17th day my process are very slow as compare to 18th
17th Oct 18th Oct
221,808,602
21
2tc2d3u52rppt
213,170,100
72,495,618
9c8wqzz7kyf37
209,239,059
71,477,888
9c8wqzz7kyf37
139,331,777
1
7b0kzmf0pfpzn
144,813,295
1
0cqc3bxxd1yqy
102,045,818
1
8vp1ap3af0ma5
128,892,787
16,673,829
84cqfur5na6fg
89,485,065
1
5kk8nd3uzkw13
127,467,250
16,642,939
1uz87xssm312g
67,520,695
8,058,820
a9n705a9gfb71
104,490,582
12,443,376
a9n705a9gfb71
62,627,205
1
ctwjy8cs6vng2
101,677,382
15,147,771
3p8q3q0scmr2k
57,965,892
268,353
akp7vwtyfmuas
98,000,414
1
0ybdwg85v9v6m
57,519,802
53
1kn9bv63xvjtc
87,293,909
1
5kk8nd3uzkw13
52,690,398
0
9btkg0axsk114
77,786,274
74
1kn9bv63xvjtc
34,767,882
1,003
bdgma0tn8ajz9
Not only queries are different but also the number of blocks read by top 10 queries are much higher on 17th than 18th.
The other big difference is the average read time on two days
Tablespace IO Stats
17th Oct
Tablespace
Reads
Av Reads/s
Av Rd(ms)
Av Blks/Rd
Writes
Av Writes/s
Buffer Waits
Av Buf Wt(ms)
INDUS_TRN_DATA01
947,766
59
4.24
4.86
185,084
11
2,887
6.42
UNDOTBS2
517,609
32
4.27
1.00
112,070
7
108
11.85
INDUS_MST_DATA01
288,994
18
8.63
8.38
52,541
3
23,490
7.45
INDUS_TRN_INDX01
223,581
14
11.50
2.03
59,882
4
533
4.26
TEMP
198,936
12
2.77
17.88
11,179
1
732
2.13
INDUS_LOG_DATA01
45,838
3
4.81
14.36
348
0
1
0.00
INDUS_TMP_DATA01
44,020
3
4.41
16.55
244
0
1,587
4.79
SYSAUX
19,373
1
19.81
1.05
14,489
1
0
0.00
INDUS_LOG_INDX01
17,559
1
4.75
1.96
2,837
0
2
0.00
SYSTEM
7,881
0
12.15
1.04
1,361
0
109
7.71
INDUS_TMP_INDX01
1,873
0
11.48
13.62
231
0
0
0.00
INDUS_MST_INDX01
256
0
13.09
1.04
194
0
2
10.00
UNDOTBS1
70
0
1.86
1.00
60
0
0
0.00
STG_DATA01
63
0
1.27
1.00
60
0
0
0.00
USERS
63
0
0.32
1.00
60
0
0
0.00
INDUS_LOB_DATA01
62
0
0.32
1.00
60
0
0
0.00
TS_AUDIT
62
0
0.48
1.00
60
0
0
0.00
18th Oct
Tablespace
Reads
Av Reads/s
Av Rd(ms)
Av Blks/Rd
Writes
Av Writes/s
Buffer Waits
Av Buf Wt(ms)
INDUS_TRN_DATA01
980,283
91
1.40
4.74The AWR reports for two days with same sqlID with different execution plan and Elapsed Time (s), Executions time please help me to find out what is reason for this change.
Please find the below detail 17th day my process are very slow as compare to 18th
You wrote with different execution plan, I think, you saw plans. It is very difficult, you get old plan.
I think Execution plans is not changed in different days, if you not added index or ...
What say ADDM report about this script?
As you know, It is normally, different Elapsed Time for same statement in different day.
It is depend your database workload.
It think you must use SQL Access and SQl Tuning advisor for this script.
You can get solution for slow running problem.
Regards
Mahir M. Quluzade -
Execution time difference between SELECT & UPDATE statement in JDBC Sender.
Hi Experts,
In my scenario, I have used the JDBC Sender Adapter with the SELECT and UPDATE statement.
Now the problem is in between the execution of Select and update statement, few more entries are coming in the same DB Table.
So result of this is updation take place for those entries which are not even picked up by the select statement.
Can we avoid this execution time difference between the SELECT & UPDATE statemet on JDBC Sender side???
Thanks & Regards
JageshHi
Use serializable option in additional parameters, now all new entries would also be updated. -
Why the execution time increases with a while loop, but not with "Run continuously" ?
Hi all,
I have a serious time problem that I don't know how to solve because I don't know exactly where it comes from.
I command two RF switches via a DAQ card (NI USB-6008). Only one position at the same time can be selected on each switch. Basically, the VI created for this functionnality (by a co-worker) resets all the DAQ outputs, and then activates the desired ones. It has three inputs, two simp0le string controls, and an array of cluster, which contains the list of all the outputs and some informations to know what is connected (specific to my application).
I use this VI in a complex application, and I get some problems with the execution time, which increased each time I callled the VI, so I made a test VI (TimeTesting.vi) to figure out where the problem came from. In this special VI I record the execution time in a csv file to analyse then with excel.
After several tests, I found that if I run this test VI with the while loop, the execution time increases at each cycle, but if I remove the while loop and use the "Run continuously" funtionnality, the execution time remains the same. In my top level application I have while loops and events, and so the execution time increases too.
Could someone explain me why the execution time increases, and how can I avoid that? I attached my test VI and the necessary subVIs, as well as a picture of a graph which shows the execution time with a while loop and with the "run continuously".
Thanks a lot for your help!
Solved!
Go to Solution.
Attachments:
TimeTesting.zip 70 KB
Graph.PNG 20 KBjul7290 wrote:
Thank you very much for your help! I added the "Clear task" vi and now it works properly.
If you are still using the RUn Continuously you should stop. That is meant strictly for debugging. In fact, I can't even tell you the last time I ever used it. If you want your code to repeat you should use loops and control the behavior of the code.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot -
Help Please!!!
I've been searching for an execution time issue in our application for a while now. Here is some background on the application:
Collects analog data from a cDAQ chassis with a 9205 at 5kHz
Data is collected in 100ms chunks
Some of the data is saved directly to a TDMS file while the rest is averaged for a single data point. That single data point is saved to disk in a text file every 200ms.
Problem: During operation, the VI that writes the data to the text file will periodically take many hundreds of milliseconds to execute. Normal operation execution times are on the order of 1ms or less. This issue will happen randomly during operation. It's usually many seconds between times that this occurs and it doesn't seem to have any pattern to when the event happens.
Attached is a screenshot of the VI in question. The timing check labeled "A" is the one that will show the troubling execution time. All the other timing checks show 0ms every time this issue occurs. I simply can't see what else is holding this thing up. The only unchecked subVI is the "append error call chain" call. I've gone through the heirarchy of that VI and ensured that everything is set for reentrant execution. I will check that too soon, but I really don't expect to find anything.
Where else can I look for where the time went? It doesn't seem to make sense.
Thanks for reading!
Tim
Attachments:
Screen Shot 2013-09-06 at 9.32.46 AM.png 87 KBYou should probably increase how much data you write with a single Write to Text File. Move the Write to Text File out of the FOR loop. Just have the data to be written autoindex to create an array of strings. The Write to Text File will accept the array of strings directly, writing a single line for each element in the arry.
Another idea I am having is to use another loop (yes another queue as well) for the writing of the file. But you put the Dequeue Element inside of another WHILE loop. On the first iteration of this inside loop, set the timeout to something normal or -1 for wait forever. Any further iteration should have a timeout of 0. You do this with a shift register. Autoindex the read strings out of the loop. This array goes straight into the Write to Text File. This way you can quickly catch up when your file write takes a long time.
NOTE: This is just a very quick example I put together. It is far from a complete idea, but it shows the general idea I was having with reading the queue.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Write all data on queue.png 16 KB -
Max execution time per pixel causing rendering differences between GPUs
Is there a maximum execution time different graphics cards
will process each pixel as part of the shader? When running the
Raytracing script (
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1634 018
) on my Macbook Pro (256MB ATI Radeon X1600) then many pixels come
out grey or black as the loop per pixel that is tracing the ray
takes longer than some built in execution limit.
I first noticed this with a filter I've been working on which
looks fine on my alu iMac (512MB Nvidia GeForce 8800 GS) but
rubbish on the Macbook Pro or older iMacs.
Are there ways around this limit like splitting long for or
while loops into smaller chunks, or is it just a hardwired max
execution time per pixel?I don't think you can time out on processing an individual
pixel, but I could be wrong. You could try reducing the number of
reflections in the filter and seeing if that fixes the problem. It
could be a math precision difference between the cards.
Shaders can (and will) time out, but individual pixels
shouldn't. It could also be a driver issue with the structure of
the filter. I have a x1600 mac book pro here and I'll try it out if
I get a chance. -
Execution time of query on different indexes
Hello,
I have a query on the table, the execution time has hugh difference using different indexes on the table. The table has about 200,000 rows. Any explaination on it?
Thanks,
create table TB_test
( A1 number(9),
A2 number(9)
select count(*) from TB_test
where A1=123 and A2=456;
A. With index IDX_test on column A1:
Create index IDX_test on TB_test(A1);
Explain plan:
SELECT STATEMENT
Cost: 3,100
SORT AGGREGATE
Bytes: 38 Cardinality: 1
TABLE ACCESS BY INDEX ROWID TABLE TB_test
Cost: 3,100 Bytes: 36 Cardinality: 1
INDEX RANGE SCAN INDEX IDX_test
Cost: 40 Cardinality: 21,271
Execution time is : 5 Minutes
B. With index IDX_test on column A1 and A2:
Create index IDX_test on TB_test(A1, A2);
Explain plan:
SELECT STATMENT
Cost: 3 Bytes: 37 Cardinality: 1
SORT AGGREGATE
Bytes: 37 Cardinality: 1
INDEX RANGE SCAN INDEZ IDX_test
Cost: 3 Bytes 37 Cardinality:1
Execution time is: 1.5 SecondsAdditional you should check how many values you have in your table for the specific column values.
The following select might be helful for that.
select count(*) "total_count"
,count(case when A1=123 then 1 end) "A1_count"
,count(case when A1=123 and A2=456 then 1 end) "A1andA2_count"
from TB_test;Share your output of this.
I expect the value for A1_count still to be high. But the value for A1+A2_count relatively low.
However 5 minutes is far to long for such a small table. Even if you run it on a laptop.
There must be a reason why it is that slow.
First thing to consider would be to update your statistics for the table and the index.
Second thing could be that the table is very sparsly fillled. Meaning, if you frequently delete records from this table and load new data using APPEND hint, then the table will grow, because the free space from the deletes is never reused. Any table access in the execution plan, will be slower then needed.
A similar thing can happen, if many updates on previously empty columns are made on a table (row chaining problem).
So if you explain a little, how this table is filled and used, we could recognize a typical pattern that leads to performance issues.
Edited by: Sven W. on Nov 28, 2012 5:54 PM -
Execution time of a simple vi too long
I'm working with LabVIEW 6.0.2 on a computer (AMD ~700MHz) under Windows 2000. The computer is connected to the instruments (eg Keithley 2400 Sourcemeter) via GPIB (NI PCI-GPIB Card). When trying to read the output of the K2400 with a very simple vi (sending the string READ? to the instrument with GPIBWrite (mode 2) and subsequently reading 100byte with GPIBRead (mode 2) from the instrument, the execution time mostly exceeds 1s (execution highlighting disabled). Sometimes, it can be much faster but this is very irreproducible. I played around with the GIPBRead and Write modes and with the number of bytes to be read from the device as well as with the hardware settings of the Keithley 2400 but nothing seemed to work. The API calls ca
ptured by NI Spy mainly (lines 8 - 160) consist of ThreadIberr() and ibwait(UD0, 0x0000).
As this problem is the main factor limiting our measurement speed, I would be grateful for any help.
Thanks a lot
Bettina WelterHello,
Thanks for contacting National Instruments. It seems like the 1 second delay that is occurring is due to the operation being called. ThreadIberr returns the value of iberr, while ibwait simply implements a wait. These two get called repeatedly while the GPIB device waits for the instrument (K2400, in your case) to finish its operation and respond back. It is quite possible that when you query the Keithley to send back 100 bytes of data, it has to gather them from its buffer (if its already been generated). And if there aren't 100 bytes of data in the buffer, the Keithley will keep the NRFD line asserted while it gathers 100 btyes of data. After the data has been gathered, the NRFD line is deasserted, at which point, ThreadIberr will detect the change in th
e ibsta status bit and read the 100 bytes.
So make sure that the 100 bytes of data that you are requesting don't take too long to be gathered, since this is where the main delay lies. Hope this information helps. Please let us know if you have further questions.
A Saha
Applications Engineering
National Instruments
Anu Saha
Academic Product Marketing Engineer
National Instruments -
Execution time of a flat-sequence
Hello there -
Is there any way to get a measurement of how long each part of
the flat sequence takes to execute? Anything like matlab's "tic" and "toc"
commands in labview? I have been playing with it for a while now and
have yet to discover if Labview has this functionality. Anyone know of
anything like this?
I currently have a VI that controls the realtime acquisition of a CCD camera via Firewire and a USB spectrometer. The VI collects data from each of these devices (triggered by an external source at 10Hz), and dumps them into a Matlab script which does analysis on the CCD image and spectrum. The bulk of the VI sits inside a while loop, which continues to run until the user presses the stop button. Inside this main loop is a flat-sequence. The sequence goes: ACQUIRE DATA ---> PROCESSING DATA ----> MATLAB SCRIPT ----> PLOTTING GRAPHS -----> OUTPUT DATA TO FILE.
The problem here is that the VI runs at 5Hz, while we are triggering it at 10Hz. Originally, it was my thought thought that the matlab algorithm was to blame, but I used the matlab commands "tic" and "toc" to determine that the matlab algorithm runs in 15-20ms. I did this by putting a "tic" command at the top of the matlab algorithm and a "toc" command at the bottom. The problem, as I have now discovered is that the rest of the labview code takes ~180ms to execute. (This was discovered by putting the "tic" at the bottom of the program, and the "toc" at the top of the program, thereby measuring the execution time of everything except the matlab algorithm). Each time a trigger signal from the external source comes in, it starts the flat-sequence structure (which takes ~190ms), and then waits for another trigger signal, always missing every second signal. My eventual goal is to reduce the bloat, and get the algorithm down to less than 100ms, so that I can run the VI and acquire data at 10Hz rather than 5Hz. If anyone can offer some help with this, it would be much appreciated!
Eric
P.S. - I have attached a copy of the VI that I am working on, but unfortunately, it most likely will not run on your computer....the VI will not run unless it is connected to a triggered spectrometer and CCD camera....but I have attached it anyways incase anyone who can help might want to take a look.
Attachments:
RTSpider.vi 376 KBcan we divide the program into 2 parts and use background process for acquisition and front end process for analysis?
I mean, create 2 VIs from the present VI and then launch the acquisition program dynamically as a background process and fire events in Main VI from acquisition VI and process it. not sure how much it is going to reduce. lets give a try....
Anil Punnam
CLD
LV 2012, TestStand 4.2..........
Maybe you are looking for
-
How to delete my old Apple ID when I updated it already from iCloud?
I recently changed my Apple ID to a new email address. My old one still is in my phone, and cannot be permanently deleted as it says that Find my iPhone is still on. I can't turn it off because I do not have the password to my old "deleted" Apple ID.
-
Problem with wget to download oracle
Hi All, I want to download http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html for my newly purchased linux server, unfortunately i have only ssh putty access to this server, i had already tried a l
-
How do I block netflix advertisement from popping up continuously.
I can't figure out how to block the annoying pop-up window ads from netflix from the address: http://cdn.optmd.com/V2/62428/198310/index.html?g=AQABUc4=&r=www.examiner.com/x-57643-LA-Environmental-News-Examiner
-
How to avoid giving credit card number
i dont want to give my credit card number when confirming my apple id what do i do
-
Has anyone else noticed that the billing has been increasing on the Freedom Essentials? I switched over in January and my bill has increased by$300 + taxes so far.