Groups | Blog | Home
all groups > sql server connect > november 2004 >

sql server connect : Local named pipes better than TCP/IP?


PerFry
11/18/2004 6:49:01 AM
Is it generally true that local named pipes are better than TCP/IP? Are there
any drawbacks?
Regards, Per.
Steve Thompson
11/18/2004 1:30:39 PM
[quoted text, click to view]

Not true.

[quoted text, click to view]

Named pipes have been around for a long, long time. Therefore on a LAN,
named pipes may give slightly better performance. However, TCP/IP is far
more tolerant and resiliant with both LAN and WAN applications.
Occaisionally, you'll find applications (mostly legacy) that will require
named pipes. A good way to handle that configure the server side network
library utility to first use TCP/IP, then named pipes (in that order).

Steve


rboyd NO[at]SPAM onlinemicrosoft.com
11/18/2004 10:03:56 PM
With SQL Server 2000 the default for local connections (connections made on
the server itself) is shared memory. Steve is correct that named pipes is
for the most part a legacy connection method. I would just use the default
of shared memory for local connections and TCP/IP for remote connections.

Rand
This posting is provided "as is" with no warranties and confers no rights.
PerFry
11/22/2004 3:53:03 AM
I'd like to stress that we're having the client and server on the same
machine, so I'm referring to _local_ named pipes. Books Online states that
"Local named pipes runs in kernel mode and is extremely fast" (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbcsql/od_odbc_g_5l9r.asp ).


[quoted text, click to view]
Matt Neerincx [MS]
12/23/2004 1:08:20 AM
IMO -> In general you are not going to see huge differences in performance
using the different network library options such as named pipes, shared
memory or tcp-ip sockets.

The reason for this is the overhead network library performance is usually
insignificant compared to perf of the client application and SQL query
performance.

So you are better off spending time optimizing your SQL queries and your
client code.

Matt


[quoted text, click to view]

PerFry
12/23/2004 1:35:02 AM
It's about what I shall recommend all our customers. I want to recommend them
the best configuration options when they choose to install our application
server and SQL Server on the same machine. So when I have to recommend
something, would it be shared memory?
/Per

[quoted text, click to view]
Matt Neerincx [MS]
1/6/2005 7:13:30 PM
Yes in this case then shared memory for local connections and TCP-IP for
remote is a good recommendation. By default the driver will automatically
pick these methods, i.e. if the driver connects to local SQL it will use
shared memory and if the driver connects to remote SQL it will use TCP-IP.

One thing you can do as well is if you want local ONLY connections in this
case (for example to avoid remote users from trying to connect to the SQL
Server) then you could disable tcp-ip protocol for SQL and only use shared
memory. For example, to follow the standard security procedure of "reducing
the attack surface" to SQL you would do this.

Matt

[quoted text, click to view]

AddThis Social Bookmark Button