Hi,
I am using a zeek (6.1.1) script to send data to a python script using broker communication. The VM has 2 cpu cores … both zeek and python script running in both the cores. While Zeek is able to send or write data using Broker::publish(sync_topic, sync_cmd, c)
In the python endpoint, we are receiving messages at very slow pace. When I bind a separate core for python script, speed increases little bit but still lagging significantly.
So, for 250 message zeek is sending in 3 seconds where python endpoint receiving in 18-20 seconds …
How to debug the issue or tune the performance, so that python end point receives it faster.
I have tried with max_threads=16 in python script, but it doesn’t help much.
Details:
python side snippet
cfg = broker.Configuration()
cfg.max_threads = 16
self.ep = broker.Endpoint(cfg)
while True:
statuses = self.ss.poll()
for s in statuses:
if s.code() in (broker.SC.PeerLost, broker.SC.EndpointUnreachable):
print("Connection reinitialized.")
continue
# Busy poll for a message or later status
msg = self.sub.get(0.0000001)
if msg is None:
continue
(topic, msgData) = msg
self.msgCounter += 1
print(f"MsgCount:{self.msgCounter}")
In publisher side I am publishing message for each event I am calling
Broker::publish(sync_topic, sync_cmd, c); print "SENT CONNECTION info", c;
The pcap will produce 252 such events and it is taking 2-3 seconds time to send or publish the message, but the python poll is picking up messages late as you can see I am just polling and printing the message count … it is taking 18 seconds. What changes or tuning should I try to enhance the broker communication performance?
Thanks
Biswa