When deploy microservices to a Kubernetes cluster in the cloud, there is no static IP and port number for these services anymore. In order to invoke these services, you either use the proxies provided by your Kubernetes cluster vendor or handling it with the light platform service registry and discovery on the host network.
We have done a performance test with one of our customers on Openshift cluster and found the following interesting numbers with one of the services built on top of light-rest-4j.
Use Openshift Proxies
Use Consul Service Discovery
As you can see, when proxies are used in Openshift, the entire cluster can only all total throughput about 2500 requests per second. Imagine that you have hundreds of services share the same throughput, then each service will only have several requests per second.
Above is the reason we have to provide our own service registry and discovery so that our services can talk to each other directory without going through any proxy. That means we don’t need any extra network hop. Given we have direct connection with HTTP 2.0 which support multiplexing, we can cache the connection for a number of minutes or a number of requests to further speed up the interaction of services.
There are several open source products that support service registry and discovery on the market. We have implemented module in light-4j to support both Consul and Zookeeper.