gRPC : Running Multiple processes on the same port in .NET Core 3.1

85 views
Skip to first unread message

Shaurya Puri

unread,
Jul 6, 2022, 3:20:18 PM7/6/22
to grpc.io
Hi, 

I am migrating an application from .NET Framework 4.7.2 (WCF) to .NET Core 3.1 (gRPC), and my current architecture has two processes running on the same port. I wanted to ask if there was a way to run two gRPC processes on the same port in .NET Core 3.1.

It is important to me that these be two individual processes, rather than two services in the same process. 


Thanks in advance.
Shaurya

Jan Tattermusch

unread,
Aug 16, 2022, 9:06:35 AM8/16/22
to grpc.io
The answer boils down to whether ASP.NET Core supports port sharing between multiple process (as gRPC server is just a special type of HTTP/2 service in a ASP.NET Core Server), and unfortunately it doesn't. 
See e.g. "All websites must run on the same Kestrel instance. Kestrel doesn't support sharing an IP address and port across multiple instances without a reverse proxy." (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-6.0)

Reply all
Reply to author
Forward
0 new messages