cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Re: Timers and Schedulers - Best Practice

Pankajphopse1
12-Amethyst

Re: Timers and Schedulers - Best Practice

Hello Adam,

Thanks for the information it was really useful, but in my case I have 100 things in which I triggered services on 1 second and 1 minute timers so as per your information i have changed execution logic under Timer Thing by calling all the services of a particular things but instead of not going to event system it started increasing the queue Size and it not going down at all.

Have you used this solution and faced the same issue? 

 

Thanks and regards,

Pankaj Phopse

 

ACCEPTED SOLUTION

Accepted Solutions

Currently I am not facing any issues with reeference to que size , but now I am facing an diffrent issue.

What I learnt is dont use timer one Second and if you are using any oher timer use Timer thing for execution, as explained in Original Post i.e. best practises for timers and schedulers.

View solution in original post

8 REPLIES 8

Hello Adam,

Thanks for the information it was really useful, but in my case I have 100 things in which I triggered services on 1 second and 1 minute timers so as per your information i have changed execution logic under Timer Thing by calling all the services of a particular things but instead of not going to event system it started increasing the queue Size and it not going down at all.

Have you used this solution and faced the same issue? 

 

Thanks and regards,

Pankaj Phopse

What type of logic are you executing, and is that logic reading any data from DataTables/Streams/ValueStreams or other data sources?

I am not calling or querying any data tables, streams or value streams. In a services i am doing basic calculations like Calclulating line status or calculating KPI like OEE, also for these calculation I have passed the inputs which i have defined in services and passing values from Kepware tags.

How many calculations are you kicking off every second?

with 100 Things I can't imagine why the Queue would be growing on you.

How much memory does the JVM have and how powerful is your server?

 

One other issue might be your remote bindings.

Check your Kepserver connector Thing (Industrial Thing) and check the remote bindings, make sure that 

1. Kep is pushing values

2. Thingworx is reading from cache (or from expiring cache with a reasonable expiration number)

 

If Thingworx is always reading values from the Edge, then every one of these calls that needs a tag value, Thingworx instead of instantly reading it from memory will make a request to the Kepserver

@PaiChung

Calculations are very simple it just doing mathmatical calculation like multiply and addition that too script code length is 50 rows,

 

Yes my JVM server is powerfull i have followed thiongworx sizing document and installed the Heavy version which is for 1 lakh things

 

Yes kep is always push and thingworx is reading from server cache.

 

 

@Pankajphopse1

 

Hope you are doing good. Could you please confirm if the issue has been resolved.

 

If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.

Regards-Mohit Goel

Currently I am not facing any issues with reeference to que size , but now I am facing an diffrent issue.

What I learnt is dont use timer one Second and if you are using any oher timer use Timer thing for execution, as explained in Original Post i.e. best practises for timers and schedulers.

try working with disabling & enabling timer in javascript service with a pause of say 1 sec -- as per your logic

see if that effects the queue size

///////////////////////////////////////////

me.DisableTimer();

logger.warn("in timer event after pause of 1 sec on enable/disable timer");

// your service execution

pause(1000);

me.EnableTimer();

Announcements


Top Tags