WCF Optimal Performance Settings

Hi, I am creating an API using WCF. My question can be divided into two separate

1) I have a lot of calls, for example, I have calls related to the client, products, orders, employees.

My question is that it all falls into one class of a public interface, like

public interface IRestService
public class RestService : IRestService

Or should I have one for each call, for example,

public interface ICustomer
public class Customer : ICustomer

public interface IProducts
public class Products: IProducts

2) If you have an API that tens of thousands of users and thousands of users will access at the same time, how would you configure what your web configuration settings will be, for example, in terms of throttling. Also, what setting could you give InstanceContextMode, or ConcurrencyMode. Finally, what type of binding would be, given that websites and mobile phones can access the api.

+3
2

API , . , , :

public class RestService : ICustomer, IProducts, IOrders

, , , , .

concurrency , . - , PerCall. , InstanceContextMode.Single ConcurrencytMode.Multiple , . : , () , .

" ", , ADO .

, . - , , . , -, . , "systemhealth.asp" . "", , - .

WebHTTPBinding REST. BasicHTTPBinding SOAP , , [WebGet].

REST, , NetTcpBinding.

+1
  • , . , . , 20 , .

  • REST? , - . WebHttpBinding ( ) InstanceContextMode (PerCall) ConcurrencyMode (Single). REST - InstanceContextMode.Single ConcurrencyMode.Multiple, singleton, . : , .

  • . ? Azure (). ( ) . MaxConcurrentInstances MaxConcurrentCalls ( PerCall instancing) ​​ . WCF 4.

+1

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


All Articles