SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hi,
I have noticed that the response time of the REST API calls is decreasing. After computer startup, the response time of the "GET /Notifications/{id}/Items" API is 300 miliseconds, after a while it is 500 miliseconds and later is may decrease to 1.2 seconds.
See our log below.
331 miliseconds
2018-12-12 13:31:06,655 [CM] INFO SEEwsRestApi - GetNotificationItems, NotificationId = '0E5B593DDC0F4E048B38BEF560D176F8'
2018-12-12 13:31:06,986 [CM] INFO SEEwsRestApi - GetNotificationItems, status code = 200, Response
...
640 miliseconds
2018-12-12 13:54:37,304 [CM] INFO SEEwsRestApi - GetNotificationItems, NotificationId = '45BF462B18C64775AA0A044FCA64E279'
2018-12-12 13:54:37,944 [CM] INFO SEEwsRestApi - GetNotificationItems, status code = 200, Response = '[]'
Any idea what is the reason fore this and how it can be avoided?
Thanks.
Mike
One more thing - a day after, the response time is amazing! The response time is less than one milisecond! See below:
2018-12-13 08:45:56,158 [CM] INFO SEEwsRestApi - GetNotificationItems, NotificationId = '44E7A9125E224BAAB14817D55F892A63'
2018-12-13 08:45:56,158 [CM] INFO SEEwsRestApi - GetNotificationItems, status code = 200, Response = '[]'
Any idea?
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
I am not sure what is going on, but I will look into it and let you know what I find.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff, my suggestion would be that this could be related to the subscription/notification not getting cleaned up properly. Would be worth checking how many records are in the db for subscriptions and notifications. Perhaps this affects the query response time internally resulting in degraded performance over time if they aren't being cleaned up?
Link copied. Please paste this link to share this article on your social media post.
Hi Adam, Jeff,
I don't see the SmartConnector databases in SQL Server Management studio... See the attached screen capture.
It seems that the SmartConnector is working fine without it...
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
Jeff,
Per your suggestion, we ran some tests to track the memory usage of the SmartConnector service. See below.
Mongoose.Service.Exe
Time Memory(K)
08:16 41,000 before starting the OPC server
08:17 109,748 After starting the OPC server
08:18 129,224
08:21 132,164
09:18 137,116
09:34 75,152
10:12 77,804
I hope it helps.
We expect that the API response time will be few miliseconds immediatly when we start our program and not only after one hour.
Thank you.
Michael
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
If I had to guess, this has to do with the caching that Smart Connector is doing for the notifications.
They are cleared every 60 minutes.. If I had to guess.. it is slow for the first hour when you start running because that is when you get ALL the points data (I think you mentioned something like 20,000 value items?) and it all gets tossed into the cache, but then after that EWS is only pulling back data that has changed, so as the original values in the cache expires, the memory usage of the cache goes down, and accessing those values are quicker.
My advice would be to only subscribe to points when you actually are using the values, not just subscribing to everything because they might be needed at some point. That way you can keep the cache memory usage smaller and improve performance. If I have some time, I will take a look and see if there is anything that can be changed in the framework to improve this performance, but likely that will take some time, and I would look at your applicaiton end first for a quick fix.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
Thank you for your answer. As you can see in the table below, there is no much difference between the memory consumption when the SmartConnector starts and after one hour. (129K vs, 78K). Do you think that this difference has such an effect on the API performance?
08:17 109,748 After starting the OPC server
08:18 129,224
08:21 132,164
09:18 137,116
09:34 75,152
10:12 77,804
Thanks.
Mike
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.