Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL named pipes on Windows--faster best practice, or bad idea?

Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows, and connect via the .NET connector driver. It's often recommended for security purposes, but one thing it allows me to do is connect with "." as the connection string and develop on my PC and deploy to the server without having to change the connection string (to point to the server host instead of my own copy of the DB).

More than that, in my experience there is some speedup I've attributed to a latency advantage over TCP. Some references I've found online echo that:

We were testing successfuly MySQL 5.0 using named pipe, and what an increase in speed! 50% in the case of this big project First it may be a good idea to use the latest JConnector driver from MySQL
http://www.waltercedric.com/component/content/article/1217.html

In simple performance tests, it appears that named pipe access is between 30%-50% faster than the standard TCP/IP access. However, this varies per system, and named pipes are slower than TCP/IP in many Windows configurations.
http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html

But in what "configurations" is it slower? Anyway, I've been proceeding on the assumption that it's faster for localhost access vs TCP, however, I haven't been able to find anything definitive. Perhaps it's more specific to the particular driver being used too.

like image 743
Garen Avatar asked May 07 '09 03:05

Garen


People also ask

Should I enable named pipes?

The Named Pipes protocol can be a better choice when the network speed is high, as it offers more functionality, easier to use, and have more configuration options.

Do named pipes use TCP?

Named pipes is a windows system for inter-process communication. In the case of SQL server, if the server is on the same machine as the client, then it is possible to use named pipes to tranfer the data, as opposed to TCP/IP.

Why named pipe is used?

Named pipes can be used to provide communication between processes on the same computer or between processes on different computers across a network. If the server service is running, all named pipes are accessible remotely.

What protocol does named pipes use?

Named pipes are also a networking protocol in the Server Message Block (SMB) suite, based on the use of a special inter-process communication (IPC) share. SMB's IPC can seamlessly and transparently pass the authentication context of the user across to Named Pipes.


1 Answers

Try looking at http://msdn.microsoft.com/en-us/library/aa178138(SQL.80).aspx

Even though it speaks about MS SQL Server, the Local named pipes running in kernel mode should still apply

From the aforementioned link:

It is also important to clarify if you are talking about local pipes or network pipes. If the server application is running locally on the computer running an instance of Microsoft® SQL Server™ 2000, the local Named Pipes protocol is an option. Local named pipes runs in kernel mode and is extremely fast.

like image 177
Elan Hasson Avatar answered Oct 03 '22 05:10

Elan Hasson