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

Stream Processing Subsystem and Multithreading at platform level

SOLVED
Level 7

Stream Processing Subsystem and Multithreading at platform level

Hello Everyone,

I had few question related to service execution and associated subsystem

1. Does anyone know if Datatable related services (like Add, Update, Delete) etc are handled through 'Stream Processing Subsystem' ? I do see a separate subsystem for valuestream but there is nothing specific to Datatable so I was wondering if the services are queued for processing (when multiple threads are trying to access the same data table) using Stream Processing Subsystem ?

 

2. The other question I had was with respect multithreading ! When Thing service (same or different) is called from an external system using REST api, will Thingworx spin up a new thread for each call ? Please clarify,

3. Also which subsystem handles the execution of thing services ? Are they executed innediately or queued based on active threads and other parameters?

4. Finally is there a way to monitor what threads are active in memory ? which processes are taking long time than usual etc ?

 

Appreciate any explanation or pointers to a guide which has this info ?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Stream Processing Subsystem and Multithreading at platform level

1. About DataTables -> It are processed synchronously, Database transaction goes through the execution of the initiating service call (and inner services from the same call), the stream processing and value stream processing doesn't takes part of it.

 

2/3. There's different pools of threads that are reused and a max thread pool size (Event Processing, WS Execution Processing,...), from TW documentation:

  • Event Processing Subsystem: The Event Processing Subsystem manages event processing for external subscriptions (Things subscribing to other Things) throughout ThingWorx
  • Message Store Subsystem: The Message Store Subsystem processes outbound queued messages for various Remote Things, including Federated Servers.
    It stores messages that will be delivered to a Remote Thing once it is online. When all of the stored messages have been delivered, the threads can be destroyed.
  • WebSocket Execution Processing Subsystem: he WebSocket (WS) Execution Processing Subsystem handles WS execution processing.
  • For REST Api Calls as far as I know it will depend on Tomcat threading model as it are initiated by Tomcat petitions. But remember that you can have Sync and Async services, for Async services (pointed out on this article: https://www.ptc.com/en/support/article?n=CS261852 ) execution should go through Event Processing Subsystem.

you have a good read on recommendations by Adam Ressler @AdamR: https://community.ptc.com/t5/IoT-Tech-Tips/Performance-Design-Pitfalls-and-Troubleshooting/m-p/53516...

 

4. As pointed out by Adam in the previous post, there's tools to do thread dump : https://marketplace.ptc.com/apps/218764/thingworx-support-tools#!overview , it's also on PTC Software Download site. And also for a more in deep analytics on execution  starting on TW 8.2 you have the PTC System Monitor 6.0 .

 

Just my two cents,

Carles.

 

4 REPLIES 4
Highlighted

Re: Stream Processing Subsystem and Multithreading at platform level

1. About DataTables -> It are processed synchronously, Database transaction goes through the execution of the initiating service call (and inner services from the same call), the stream processing and value stream processing doesn't takes part of it.

 

2/3. There's different pools of threads that are reused and a max thread pool size (Event Processing, WS Execution Processing,...), from TW documentation:

  • Event Processing Subsystem: The Event Processing Subsystem manages event processing for external subscriptions (Things subscribing to other Things) throughout ThingWorx
  • Message Store Subsystem: The Message Store Subsystem processes outbound queued messages for various Remote Things, including Federated Servers.
    It stores messages that will be delivered to a Remote Thing once it is online. When all of the stored messages have been delivered, the threads can be destroyed.
  • WebSocket Execution Processing Subsystem: he WebSocket (WS) Execution Processing Subsystem handles WS execution processing.
  • For REST Api Calls as far as I know it will depend on Tomcat threading model as it are initiated by Tomcat petitions. But remember that you can have Sync and Async services, for Async services (pointed out on this article: https://www.ptc.com/en/support/article?n=CS261852 ) execution should go through Event Processing Subsystem.

you have a good read on recommendations by Adam Ressler @AdamR: https://community.ptc.com/t5/IoT-Tech-Tips/Performance-Design-Pitfalls-and-Troubleshooting/m-p/53516...

 

4. As pointed out by Adam in the previous post, there's tools to do thread dump : https://marketplace.ptc.com/apps/218764/thingworx-support-tools#!overview , it's also on PTC Software Download site. And also for a more in deep analytics on execution  starting on TW 8.2 you have the PTC System Monitor 6.0 .

 

Just my two cents,

Carles.

 

Re: Stream Processing Subsystem and Multithreading at platform level

thanks @CarlesColl for the reply and pointers to the guide. One follow up is that in point #1, I was talking about Thingworx Data tables and not Database Tables ! Are the TWX Data table services handled synchronously ? or you are talking about Database tables ?

Re: Stream Processing Subsystem and Multithreading at platform level

Either I was referring to Thingworx Data tables

Re: Stream Processing Subsystem and Multithreading at platform level

Hi @raghunayak.

 

If the reply from @CarlesColl answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon