-
Notifications
You must be signed in to change notification settings - Fork 332
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
Support named pipe connections #454
Comments
@vaintroub I'm not familiar with C/NET's implementation (I try to not look at their code) but am wondering what you consider the hallmarks of a "good" implementation? I already have a transport layer that works over |
Good is fast . I do not know why, but in C/NET pipe is substantially slower than TCP, and it should be maybe 1.´5-2x faster than local TCP connection, for simple queries like "do 1", or even slightly more complex ones like "select 1" . I think NamedPipeClientStream is going to do OK, but if you could benchmark this against TCP, you'll know more. |
I've got some initial performance numbers back, and they're not great. TCP
Named Pipe
OTOH, they're much better than MySql.Data 8.0.11: MySql.Data 8.0.11 Named Pipe
I'd love to benchmark local TCP/IP connections with SIO_LOOPBACK_FAST_PATH enabled; that might be the best way to get high-performance local communication on Windows. (But I assume that would require building a custom version of MySQL Server.) This shipped in 0.41.0 with these performance numbers. I can potentially revisit it in the future based on user feedback. |
I doubt that any TCP (even with FAST path) is better than named pipe. Can you share your code? |
Named pipe is opened in this function:
Reading/writing the stream happens here: https://github.com/mysql-net/MySqlConnector/blob/dce98defdffaf8ccffb4b795187157d096e13f17/src/MySqlConnector/Protocol/Serialization/StreamByteHandler.cs I/O is buffered here: https://github.com/mysql-net/MySqlConnector/blob/dce98defdffaf8ccffb4b795187157d096e13f17/src/MySqlConnector/Protocol/Serialization/BufferedByteReader.cs
Does the JDBC driver use a "stream" abstraction, just talk directly to the Win32 API, something else? |
JDBC uses java.io.RandomAccessFile for reading and writing ( but it extends Socket , because this is how different transports are implemented in this driver). It uses native code, only for "busy pipe" workaround (Java would throw FileNotFoundException on many concurrent connect requests). If native code is not possible, there is just retry after some sleep. |
Named pipe connections on Windows are not supported. (Unlike e.g Unix domain socket connections, which are supported).
When implemented well (not like in C/NET, but e.g like in MariaDB's JDBC ), local named pipe connections can be a lot faster than TCP.
The text was updated successfully, but these errors were encountered: