Garnet, on io_uring with kTLS #2012
mgravell
started this conversation in
Show and tell
Replies: 1 comment
|
Really nice exploration, thank you Marc! We were hopeful of reaching this at some point (there are internal eRPC and MsQuic stacks we have experimented with Garnet in the past). This is the closest to something that could actually ship cleanly. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
So; entirely for fun, I've been playing with a general purpose high performance network layer for .NET,
SocketSet- it does not use managed sockets, instead using the raw kernel APIs (ok, with managed sockets as the final fallback for compatibility reasons). Since Garnet has a nice pluggable network layer (kudos for that, btw), I thought I'd have some fun with Garnet!Currently implemented in
SocketSet:Technically the design also naturally fits DPDK, but I have not yet explored that (frankly, the "good" hardware for that is far outside my budget), however; key findings so far are that on Linux it is reliably either the same or better than the default managed sockets implementation. I do not have the correct lab setup to properly demonstrate kTLS, which requires at least multiple boxes with fast links, and ideally kTLS-enabled enterprise NICs - with that setup, kTLS should fly (server-to-client, at least - kTLS seems happier with Tx than Rx).
Status
super experimental at the moment - I mostly wanted to put it on your radar as a discussion piece; see https://github.com/mgravell/SocketSet/tree/main/GarnetDemo
Example results
Abstract UDS (measuring raw IO perf):
-P 1GET-P 1SET-P 16GET-P 16SETTLS comparison, without benefitting from kTLS awesomesauce:
-P 1GET-P 1SET-P 16GET-P 16SETAnd the best bit: at least at the current time, there's no "Garnet needs to take a dependency" here - all the fun is can be achieved via a separate layer like
SocketSet.Garnet- although it would need folks to self host rather than using the oh-so-convenientgarnet-serverglobal tool.One small upstream UDS note: Garnet's embedding path (
GarnetServerwithservers == null) requiresUnixSocketPathand unconditionally callsFile.Deletebefore binding, which can never wok with abstract names because of the leading NUL. We hacked around it, but it would be super nice if we could just useUnixDomainSocketEndPoint("\0name")and have it do the right thing re chmod and delete. Bonus points if the wider piece also allowed socat/systemd conventions, i.e.@namegets interpreted as\0name, at least on Linux. I'm proposing the same thing over on redis/redis.All reactions