Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use epoll #248

Closed
xhebox opened this issue Mar 13, 2023 · 4 comments
Closed

Use epoll #248

xhebox opened this issue Mar 13, 2023 · 4 comments

Comments

@xhebox
Copy link
Collaborator

xhebox commented Mar 13, 2023

Goal

  1. reduce goroutine number
  2. avoid buffer copying
  3. The current backend must convert from *PacketIO oriented to []byte/MysqlPacket oriented. Command processor or authenticator should not read from the connection actively. To do this, we should provide a set of helper parsing/making packets.

Lots of refactors are needed, since blocking & non-blocking code will be totally different.

@dveeden
Copy link
Contributor

dveeden commented Dec 29, 2023

Might be good to consider io_uring as well. Not sure which one is better.

@xhebox
Copy link
Collaborator Author

xhebox commented Jan 2, 2024

Might be good to consider io_uring as well. Not sure which one is better.

Sounds good. But I am not aware of any golang io_uring implementation. And it requires a pretty new kernel support...

@dveeden
Copy link
Contributor

dveeden commented Jan 2, 2024

I found these:

And while io_uring looks interesting there are some tests that don't show a clear winner:

So this may or may not be the right choice.

@djshow832
Copy link
Collaborator

Tested gnet and netpoll. Both perform worse than go net because EpollWait runs more frequently.
io_uring is not mature enough and is barely used in mission-critical software, so I won't consider it shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants