-
If I understand correctly io_uring still preferes to use non blocking sockets , because otherwise it will create io-wq for a blocking send of the whole buffer. Non blocking send can acccept less bytes than requested, when it happens subsequent write request returns EAGAIN until socket can accept more data. In a non-uring world writing whole buffer to a non blocking socket works like following:
How does it translate to liburing? Do we need to poll or CQE is posted when socket is writable and next write can be made immediately? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Reading #364 (comment) it seems that "best" mode is O_NOBLOCK and io_uring does the optimal thing:
am I right? |
Beta Was this translation helpful? Give feedback.
-
Offloading to worker threads (i.e. io-wq) is a slow path, io_uring doesn't do requests this way by default regardless whether it's I'd recommend, do a normal non-blocking socket and just issue sends. io_uring will internally poll the socket for you if needed. There might be merit in polling if you're streaming (in contrast to more of a ping pong pattern) and running out of space in tx queues. Also, if you set |
Beta Was this translation helpful? Give feedback.
-
Found it: torvalds/linux@4c3c094
|
Beta Was this translation helpful? Give feedback.
-
assuming TCP connection hangs and no remote peer ACKs can be received. socket sendbuffer is 64kb and it is currently empty, we submit send op for 128kb buffer on a normal socket with no additional flags, what will happen?
Or
Or
Or
In your view, which response size can be seen as streaming? |
Beta Was this translation helpful? Give feedback.
assuming TCP connection hangs and no remote peer ACKs can be received. socket sendbuffer is 64kb and it is currently empty, we submit send op for 128kb buffer on a normal socket with no additional flags, what will happen?
Or
Or