liburing: zero-copy send doesn't have better performance

My test was running on two physical machines (20Gbps bonding NICs), kernel version 6.2.0-1.el7.elrepo.x86_64.

First I setup a tcp server on one machine, and then run these two commands on the other, to compare send_zc and send performance.

./example/send-zerocopy -n8 -s32768 -4 -t20 -D11.158.242.44 -p9527 -z1 tcp tx=1294016 (MB=40438), tx/s=64700 (MB/s=2021)

./example/send-zerocopy -n8 -s32768 -4 -t20 -D11.158.242.44 -p9527 -z0 tcp tx=1528384 (MB=46343), tx/s=76419 (MB/s=2317)

The send_zc is even worse …

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 27

Commits related to this issue

Most upvoted comments

@isilence

  1. I think the bonding NICs is useful when handling multiple connections, for this test there is only one. So the max bandwidth is 20G.
  2. I noticed that the latest example in master has been changed by adding IORING_SETUP_DEFER_TASKRUN | IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_COOP_TASKRUN and setting set_iowq_affinity. I re-run the new zc example, now it could reach the 20G limit. And CPU util is less than normal tcp, looks good.
  3. TCP_NODELAY did have negative impact, but very small. Let’s forget it.

@isilence

case 1: ./examples/send-zerocopy -n1 -s32768 -4 -t20 -D11.158.242.44 -p9527 -z0 -d tcp tx=1616716 (MB=50363), tx/s=80835 (MB/s=2518) CPU usage: 56% copy.txt

case 2: ./examples/send-zerocopy -n1 -s32768 -4 -t20 -D11.158.242.44 -p9527 -z1 -d tcp tx=1494701 (MB=46709), tx/s=74735 (MB/s=2335) CPU usage: 48% zc.txt

Another observation is that according to logs is that often it goes via the slow path (internal worker thread pool, aka io-wq)

Just for my education, where do you see it?

In the @beef9999 's logs, look for io_wq, e.g. io_wq_submit_work