Replies: 1 comment 22 replies
-
if i remember right the GIL will never let a python process use 100% CPU usage subscription = await client.create_subscription(100, handler)
await subscription.subscribe_data_change(nodes[:int(len(nodes)/2)])
subscription2 = await client.create_subscription(100, handler2)
await subscription2.subscribe_data_change(nodes[int(len(nodes)/2):]) it does not look like you set a queuesize at all !? opcua-asyncio/asyncua/common/subscription.py Line 169 in 085b00e async def subscribe_data_change(self,
nodes: Union[Node, Iterable[Node]],
attr=ua.AttributeIds.Value,
queuesize=0,
monitoring=ua.MonitoringMode.Reporting,
) -> Union[int, List[Union[int, ua.StatusCode]]]: |
Beta Was this translation helpful? Give feedback.
22 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a server that publishes 100 variables and randomly increments one variable every 0.01 second (it amounts to less than a hundred updates per second):
server.py
And I run a corresponding client on a same server:
client.py
The problem is server reports:
2021-08-03 20:20:52.403 INFO uaprocessor forward_publish_response Server wants to send publish answer but no publish request is available,enqueuing notification, length of result queue is 19321
So the queue grows and datachange notifications are arriving later and later on the client.
I have tried to:
client.create_subscription(100, handler)
. I started from the default 500, and 100 seems to be the best, but I still see a growing queue and a growing processing time.That also didn't help.
Notes:
await asyncio.sleep(.01)
inserver.py
to slow updates, i.e.:await asyncio.sleep(.05)
the queue disappears.SubscriptionHandler:datachange_notification
performance and it consistently completes under 1 ms. But even when left withpass
only the server queue grows quite fast.Am I missing something? Is it possible to speed it up somehow?
Beta Was this translation helpful? Give feedback.
All reactions