Skip to content

Asyncore poller efficiency #1380

Open
Open
@PeterSurda

Description

@PeterSurda

Asyncore pollers initialise the poller objects for every poll. This causes inefficiency when using a huge number of connections. It's only necessary to do it this way for the select poller, the others can reuse an old object. To fix this requires some refactoring, instead of performing a check and set/reset for every connection for every poll, the set/reset can be done when the write or read buffer get updated. This reduces the number of checks as well as syscalls. I managed to get a prototype working on one of the bootstrap servers, and it reduced the CPU usage of the asyncore loop by a factor of 6. However it needs more work as it was only done with the epoll poller, and I had to disable the bandwidth limit functionality.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions