frevib / io_uring-echo-server

io_uring echo server
MIT License
365 stars 55 forks source link

Code cleanup and fix #1 #2

Closed CarterLi closed 4 years ago

CarterLi commented 4 years ago

I got about 20% performance reduction for not sending redundant text, details unknown

frevib commented 4 years ago

Thanks for taking the time! I will merge when I have some time to look at it.

Strange that we have -20% performance.

frevib commented 4 years ago

I get about -75% performance when not sending redundant text.

CarterLi commented 4 years ago

Do you getter better performance with sendmsg/recvmsg?

No, I don't. But sendmsg/recvmsg won't raise SIGPIPE when there are huge number of connections.

We might have to wait until Linux 5.6, will support send/recv.

send/recv won't be much better then sendmsg/recvmsg, except send/recv are easier to setup.

I will test send/recv when Ubuntu's daily build comes out. For now send/recv are unusable due to this bug

I get about -75% performance when not sending redundant text.

Really?

CarterLi commented 4 years ago

I'd like to contribute my (customized) code to liburing examples, it could be useful for benchmarking for the creator of io_uring IMO.

Nevertheless it's modified from your repo. Would you agree with that?

frevib commented 4 years ago

I'd like to contribute my (customized) code to liburing examples, it could be useful for benchmarking for the creator of io_uring IMO.

Nevertheless it's modified from your repo. Would you agree with that?

Absolutely, go for it :)

frevib commented 4 years ago

We might have to wait until Linux 5.6, will support send/recv.

send/recv won't be much better then sendmsg/recvmsg, except send/recv are easier to setup.

Agree. On another note I've had the problem that when using io_uring_prep_readv, cqe->res was returning negative values when using Linux < 5.4 (maybe lower). So I would like to see what send/recv is doing.

I will test send/recv when Ubuntu's daily build comes out. For now send/recv are unusable due to this bug

I get about -75% performance when not sending redundant text.

Really?

Yes, see https://github.com/frevib/io_uring-echo-server/pull/2#pullrequestreview-355117825

CarterLi commented 4 years ago

We might have to wait until Linux 5.6, will support send/recv.

send/recv won't be much better then sendmsg/recvmsg, except send/recv are easier to setup.

Agree. On another note I've had the problem that when using io_uring_prep_readv, cqe->res was returning negative values when using Linux < 5.4 (maybe lower). So I would like to see what send/recv is doing.

Negative value returned by cqe-res is -errno What values were returned?

I will test send/recv when Ubuntu's daily build comes out. For now send/recv are unusable due to this bug

I get about -75% performance when not sending redundant text.

Really?

Yes, see #2 (review)

I saw your twitter.

simple echo server. io_uring +99% performance, -45% cpu usage.

Wasn't the performance boost too huge? ;)

frevib commented 4 years ago

We might have to wait until Linux 5.6, will support send/recv.

send/recv won't be much better then sendmsg/recvmsg, except send/recv are easier to setup.

Agree. On another note I've had the problem that when using io_uring_prep_readv, cqe->res was returning negative values when using Linux < 5.4 (maybe lower). So I would like to see what send/recv is doing.

Negative value returned by cqe-res is -errno What values were returned?

If I remember correctly -22 and for and for a different echo server -14. I can rollback the kernel and try.

I will test send/recv when Ubuntu's daily build comes out. For now send/recv are unusable due to this bug

I get about -75% performance when not sending redundant text.

Really?

Yes, see #2 (review)

I saw your twitter.

simple echo server. io_uring +99% performance, -45% cpu usage.

Wasn't the performance boost too huge? ;)

Yes, unrealistically huge. I can't believe it's only io_uring itself doing it, maybe vectored read/write also has something to do with it.

CarterLi commented 4 years ago

We might have to wait until Linux 5.6, will support send/recv.

send/recv won't be much better then sendmsg/recvmsg, except send/recv are easier to setup.

Agree. On another note I've had the problem that when using io_uring_prep_readv, cqe->res was returning negative values when using Linux < 5.4 (maybe lower). So I would like to see what send/recv is doing.

Negative value returned by cqe-res is -errno What values were returned?

If I remember correctly -22 and for and for a different echo server -14. I can rollback the kernel and try.

  1. -22: -EINVAL, Invalid argument
  2. -14: -EFAULT, Bad address. It can be caused by a kernel bug. If you are sure you may file a bug report here