# Degraded Scanclass Performance - UaTcpClientAcknowledgeHandler?

**URL:** <https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [May 7, 2019, 9:46pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770 "2019-05-07T21:46:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 7, 2019, 9:46pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/1 "2019-05-07T21:46:14Z")

</div>

I’m experiencing a deluge of these warnings the past couple of weeks that I assumed were the cause of my degraded tag scanclass performance. Finally found the related logger, or so I think, since the events are paired:

 ![logs](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1832b45a124dfe434440e003ee96e31083772a88.png)

For context: only a single designer session is open, all database connections are disabled, all UA Server connections are disabled. Not sure what to make of this, or if it’s related to my scanclass issue. Due to some non-compliance in the UA Servers all tags are setup in a single scanclass using OPC Read Mode. Also thinking there could simply be too many tags to poll in a single scanclass?

The worst evaluation time on the SC has clocked in at over 3 minutes. Any changes to the tags take very long to actually process and hang up the Designer GUI.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 7, 2019, 9:48pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/2 "2019-05-07T21:48:00Z")

</div>

Possible similar issue:

> [@High CPU Usage for Thread](http://forum.inductiveautomation.com/t/high-cpu-usage-for-thread/20191):
>
> Hey all, Can someone tell me what this thread is? It’s constantly using a very high amount of CPU, if I restart the server it calms down for a week or two and then starts doing it again. I’m guessing it’s something for the UA server? How do I go about figuring out why it’s using so much CPU resources? Thread [ua-netty-event-loop-0] id=153, (RUNNABLE) sun.misc.Unsafe.unpark(Native Method) java.util.concurrent.locks.LockSupport.unpark(LockSupport.java:141) java.util.concurrent.SynchronousQ…

Previous thread covering these peculiar UA servers:

> [@OPC-UA Server Connections and Tag Issues](http://forum.inductiveautomation.com/t/opc-ua-server-connections-and-tag-issues/22206/19):
>
> Disabling the OPC UA server connection does stop the warnings Strangely when re-enabling the connection all the tag values report correctly, but the Bad\_ServiceUnsupported messages resume and the values/timestamps no longer update after the initial read. The sequence of UaSubscriptionChangeListener logs: [D] Synchronizing subscriptions… [D] Creating/deleting items on subscription ‘Scanclass ‘Default[default]’’ [D] nodesToAdd.size()=0 [D] nodesToRemove.size()=0 [D] Setting MonitoringMode to R…

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 7, 2019, 9:51pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/3 "2019-05-07T21:51:27Z")

</div>

I’ve been slowly adding UA connections back with no ill effects yet.  
However the above nuisance errors never stopped logging.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 7, 2019, 10:04pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/4 "2019-05-07T22:04:12Z")

</div>

If you click that “+” button to expand is there any more detail?

I suppose anythings possible, but I’d expect these errors to mean you have a few UA connections that aren’t connected.

The only way that would effect scan class execution times is if you had scripts doing system.opc.read and system.opc.write against UA connections that weren’t connected and they were being delayed for some reason.

edit: to be clear, it would have to be tags with `runScript` expression calling code that used those functions…

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 7, 2019, 10:30pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/5 "2019-05-07T22:30:36Z")

</div>

The DefaultChannelPipeline logger warnings ends in:  
`java.io.IOException: An Existing connection was forcibly closed by the remote host.`

The server IP is the one ending in .17, the device is the .41:8085.  
Apparently that was a soft controller that did not have a UA Server deployed to it yet. Deploying a server to the device stopped the errors! Oddly enough that UA Server connection was disabled the entire time…

Still debugging scanclass issue, which appears unrelated.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 7, 2019, 10:34pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/6 "2019-05-07T22:34:01Z")

</div>

The most common causes for slow scanclass execution are slow expressions (due to usages of `runScript`) and slow DB query tags.

If your scan classes are in OPC Read Mode that can play into it as well.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 7, 2019, 10:51pm UTC](https://forum.inductiveautomation.com/t/degraded-scanclass-performance-uatcpclientacknowledgehandler/24770/7 "2019-05-07T22:51:59Z")

</div>

Thankfully I learned that lesson before, so no runScript in these tags. 🙂

I’ve re-enabled all UA servers we’re concerned with and the SC execution remains stable and fast.  
Wondering if the above errors were indeed related… I assumed not since they were still accumulating after disabling all servers, but the scanclass execution sped up. A real test would be to deploy again without a server. Will try to follow up with the control logic integrator.
