WCF service hosted in a console application

How many downloads can the WCF service hosted in the console handle use? Can it handle incoming requests in the same way as WCF hosted in IIS?

Additional notes: Can requests come simultaneously?

I have a WCF service hosted in a console application. I am calling this WCF service from a web application. This web application can have hundreds of requests at a time.

I simulated loading requests, but I could not find out if the console application hosting the WCF service responded either simultaneously or sequentially.

+4
source share
2 answers

It doesn't matter where the WCF service is hosted. It all depends on the binding settings, the endpoint, the behavior of the endpoints and the behavior parameters of the service, and, last but not least, on how you set (through the attributes) the instancing mode and the concurrency type for your service.

These settings are carried over by ServiceHost . Even if it works in a console application, the application itself is just a container for ServiceHost , which creates a runtime for your WCF service based on the settings you give it.

What interests you, see here (concurrency and throttling). In addition, something is very extended in WCF instance modes .

For performance reasons, I recommend that you use a single-user service, which you can specify through InstanceContextMode. If you have hundreds of requests, they will not benefit concurrency if a service instance is created for each request. You should consider whether monotonous use is possible in your case, checking if all of your service operations are thread safe.

+7
source

How much download can a WCF service hosted in a console application use?

How much can your computer use the self-service WCF service.

The host can be a console application or a Windows service, it does not matter, in terms of download, they are the same.

+1
source

All Articles