-
Notifications
You must be signed in to change notification settings - Fork 7
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
Reading/writing on sockets starts several iou-wrk
"workers"
#56
Comments
Hmmmm 🤔
|
See also netty/netty-incubator-transport-io_uring#156. Seems they are using a more "traditional" technique of polling before read/writing 🤔 |
A simpler reproducer, separated into an independent server and client. The server is an echo. The client writes but does not read. Both applications end up with an //> using lib "com.armanbilge::fs2-io_uring::0.1.0"
//> using platform "native"
// brew install liburing
//> using nativeCompile "-I/home/linuxbrew/.linuxbrew/include"
//> using nativeLinking "/home/linuxbrew/.linuxbrew/lib/liburing.a"
import cats.effect.*
import cats.syntax.all.*
import fs2.*
import fs2.io.uring.*
import fs2.io.uring.net.*
import com.comcast.ip4s.*
object Server extends UringApp.Simple:
def run =
UringSocketGroup[IO].serverResource(port = port"8080".some).use {
(address, clients) =>
val echoServer = clients.map { c =>
Stream.exec(IO.println("client accepted")) ++
c.reads.through(c.writes)
}.parJoinUnbounded
IO.println(address) *>
echoServer.compile.drain
} //> using lib "com.armanbilge::fs2-io_uring::0.1.0"
//> using platform "native"
// brew install liburing
//> using nativeCompile "-I/home/linuxbrew/.linuxbrew/include"
//> using nativeLinking "/home/linuxbrew/.linuxbrew/lib/liburing.a"
import cats.effect.*
import cats.syntax.all.*
import fs2.*
import fs2.io.uring.*
import fs2.io.uring.net.*
import com.comcast.ip4s.*
object Client extends UringApp.Simple:
def run =
UringSocketGroup[IO].client(SocketAddress.fromString("localhost:8080").get).use { client =>
IO.println("connected") *>
client.write(Chunk.constant(0.toByte, 1024)).foreverM
} |
Seems the best answer we have right now is to just use a newer kernel 🙃 |
For the record I was observing issues with kernel 5.15.
|
Consider the following fs2-io_uring program, which starts an echo server and connects a number of clients.
If we start a 100 concurrent clients like so:
We can observe a number of
iou-wrk
threads. I observed it to fluctuate between 10-50.I'm not sure what to make of this. I'm pretty sure we don't want this, since more threads are bad for performance. But I also don't understand where these threads are coming from anyway! Reading / writing to sockets should be non-blocking ...
Best reading on this topic I'm aware of is:
The text was updated successfully, but these errors were encountered: