Which WCF binding is most effective?

I need to get the best performance in my WCF service. In one of my tests, the service below received only 50 thousand data per minute using NetTcpBinding. Will a disconnected binding, such as NetMsmqBinding, improve this performance?

The service and client use WCF and run on the same computer.

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
    ConcurrencyMode = ConcurrencyMode.Multiple)]
public class Storage : IStorage
{
    protected List<int> _data = new List<int>();

    public void Insert(int[] data)
    {
        lock (_data)
        {
            _data.AddRange(data);
        }
    }

    public int[] Get()
    {
        lock (_data)
        {
            return _data.ToArray();
        }
    }
}

The code above is a simplified version of the actual code.

+3
source share
4 answers

Msmq is likely to be slower than TcpBinding.

, NetNamedPipeBinding (IPC), .

, . ( ), WCF ( ).

+4

?

NetMsmq MSMQ - , MSMQ, . , .

NetTcp, , http - . ( ) . , - /.

, , . :

  • , , / , / → netTcp

  • , . - - -, , , ( , )

, - , , , , :)

+4

, IPC, . , IPC.

+3

, , ? ? , "Get" .

What is the name of this service? Would this help multithreading? How about using a more complex lock, such as ReaderWriterLock, which allows you to make multiple Get calls at the same time, but still block the "Add"?

Edit: I know this is a simplified situation, but will the actual service be beneficial for the same reasons?

+2
source

Source: https://habr.com/ru/post/1724519/