2

No one answers me correctly or with an official resource to this matter. I have a server and many modules. Each module will create a named pipe and the server will create one named pipe per module. I need to know how many named pipes can I have at the same time.

I'm not planning on connecting them like 10 clients to 1 server, no. I want to connect 1 client to 1 server always, but how many of this pipes can I make?

Note that I'm using WCF in C#.

Bhavin
  • 27,155
  • 11
  • 55
  • 94
AAlferez
  • 1,480
  • 1
  • 22
  • 48

2 Answers2

4

Each named pipe created in Windows uses some system resources, which means there is a practical limit on the number of pipes which can be created. See:

Every time a named pipe is created, the system creates the inbound and/or outbound buffers using nonpaged pool, which is the physical memory used by the kernel. The number of pipe instances (as well as objects such as threads and processes) that you can create is limited by the available nonpaged pool.

The exact numerical limit will depend on your system, but it is likely to be at least in the order of hundreds if not thousands.

When the pipes are being created using the WCF Named Pipe Binding, you can only create one pipe per base address, due to the way in which this binding publishes metadata about the pipe being used. It is therefore best to define WCF endpoints using absolute URI addresses rather than base address + relative. Provided you do this, and design a reasonable scheme for creating a unique absolute address for each endpoint, there is no fixed limit that I know of to the number of WCF endpoints you can create.

The actual practical limit on any particular system can only be discovered empirically. If your goal is to have a few tens of endpoints, I would guess that you will be able to achieve this comfortably. If you want to have thousands operating concurrently you may bring the practical limit of system resources into play. Only testing will determine this for sure.

Chris Dickson
  • 11,964
  • 1
  • 39
  • 60
  • I'm going to be using 12 right now but if I expand my program with more modules, maybe I will be around 20 and I dont want this to be a limitation on my expandability – AAlferez Aug 07 '13 at 12:15
0

First I wanted to tell you that you should explain the Question properly, otherwise no one will help you here. Explain where is the problem you faced and show us some code also.

From your explanation, i found that what you want is this : Number of Clients that can connect to a Named Pipe.

Community
  • 1
  • 1
Jignesh.Raj
  • 5,776
  • 4
  • 27
  • 56
  • 2
    Thats not what I asked. I dont want to know how many clients can connect to a Named Pipe. I need to know how many NAMED PIPES CAN I CREATE: `DuplexChannelFactory pipeFactory = pipeFactory = new DuplexChannelFactory( myCallbacks, "ClientEndpointInClient");` – AAlferez Aug 05 '13 at 17:06