Skip to content

[Bug] Sudden high latency between publisher and subscriber #540

@aipiano

Description

@aipiano

Describe the bug

I use zenoh python to pub and sub a small message(about 512 bytes) and measure the delay between pub and sub.
It may delay about 5 seconds when I run the script for a long enough time.

Image

Is it a bug?
Or how can I tune the performance by config.

To reproduce

Publisher:

session = zenoh.open(zenoh.Config())
pub = session.declare_publisher("some/key")

while True:
    rb = random.randbytes(512)
    timestamp = int(time.time() * 1000)
    print(timestamp)
    pub.put(rb, attachment=f"{timestamp}")
    time.sleep(0.05)

Subscriber:

session = zenoh.open(zenoh.Config())
sub = session.declare_subscriber("some/key")

for sample in sub:
    timestamp = int(time.time() * 1000)
    b = sample.payload.to_bytes()
    t = sample.attachment.to_string()
    print(f"Delay time {int(timestamp) - int(t)}")

System info

Platform: Ubuntu22.04 64bits
Zenoh version: 1.4.0
CPU: Intel Core i7-13700H

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions