views:

1762

answers:

2

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:

http://www.waltercedric.com/component/content/article/1217.html

"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://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.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."

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.

+3  A: 

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.

Elan Hasson
A: 

I did a quick test - dumping a db to a file and reimporting it on my XP dev machine. No difference showed - results remained the same.

What would influence named pipes to be slower or faster?

Thanks

One aspect would be that there is overhead in creating/destroying a connection. For a dump you would pay a one time cost for the connection which you'd only need to do once, and so the difference would be negligible.
Garen