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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Stream Processing Subsystem and Multithreading at platform level

raghunayak
6-Contributor

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

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/535165#M347%3F

 

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.

 

View solution in original post

4 REPLIES 4

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/535165#M347%3F

 

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.

 

raghunayak
6-Contributor
(To:CarlesColl)

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 ?

Either I was referring to Thingworx Data tables

slangley
23-Emerald II
(To:CarlesColl)

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

Top Tags