High CPU Usage for Thread

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.SynchronousQueue$TransferStack$SNode.tryMatch(SynchronousQueue.java:265)
  java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:383)
  java.util.concurrent.SynchronousQueue.offer(SynchronousQueue.java:913)
  java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1361)
  org.eclipse.milo.opcua.stack.client.UaTcpStackClient.lambda$sendRequest$8(UaTcpStackClient.java:219)
  org.eclipse.milo.opcua.stack.client.UaTcpStackClient$$Lambda$287/1333559766.operationComplete(Unknown Source)
  io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:683)
  io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:568)
  io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:425)
  io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetFailure(AbstractChannel.java:847)
  io.netty.channel.AbstractChannel$AbstractUnsafe.write(AbstractChannel.java:734)
  io.netty.channel.DefaultChannelPipeline$HeadContext.write(DefaultChannelPipeline.java:1304)
  io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:619)
  io.netty.channel.AbstractChannelHandlerContext.access$1800(AbstractChannelHandlerContext.java:32)
  io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:904)
  io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:956)
  io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:889)
  io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:374)
  io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
  java.lang.Thread.run(Thread.java:745)

Looks like the OPC/UA client, not the server. Are you connecting to a 3rd-party OPC server? Or is there just the one internal connection?

I do have a Kepware OPC server that is connected via OPC-UA. I also have a few Siemens PLC’s that are connected directly to Ignition via their internal OPC-UA server, I guess it could be one of those. Is there a way to narrow it down to a specific connection other than shutting it down?

There might be a log context filter you could use – it’s not immediately obvious to me.

When you notice this high CPU usage again turn the logger for UaTcpStackClient to DEBUG level. If you see a bunch of messages suddenly spam your log then this is an issue we have a fix coming for in 7.9.11.

2 Likes

You mean like this?

Yep, that’s the one!

Ok, cool. It doesn’t seem to be having a huge effect on anything other than annoying our server administrator :wink: so I’ll restart until the new version comes out. Thanks guys!