Skip to content

performance decay with yield from ws.send multi connection #580

@hippo-dalaoshe

Description

@hippo-dalaoshe

Version

python 3.4
websockets 4.0.1

I use one main thread and one event loop to handle websocket connection, and echo every msg to the client connection.
I find that, when increase the connection with 1 msg/s per connection, the request arrive time (time interval between the request is sent from client and the request is recv from yield from connection.recv()) will increase quickly.
In my test environment, all client and the server are deploy in the same local network, and only one connection, the arrival time delay is about 20ms, but when it increase to 500 connection, the delay is up to 500ms - 1s.

I think the problem happen in the yield from connection.send() call, may the send buffer or recv buffer is low performance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions