Just a simple app to replicate the issue of gRPC slowness deployed to Kubernetes when compared to WebSockets. Helm chart was taken from oci://registry.jetbrains.team/p/cb/helm-charts/simple-app, only imagePullPolicy: Always was modified.
The app just sends files in 4MB chunks to the server, and the server just sends the received chunk back to a client.
I tried to send files from JDK folder and the times are following:
gRPC--> [2m 19.193481167s, 2m 19.058280917s, 2m 16.844568375s]WebSockets--> [24.140014083s, 23.141296625s, 23.184500708s]
Run your own experiment from Client.kt file.
- before you build a docker image, build the app:
./gradlew clean && ./gradlew installDist
- build docker image for local usage:
docker build --platform=linux/amd64 -t nginx-issue -f Dockerfile .
- build docker and push to registry:
docker buildx build --platform linux/amd64,linux/arm64 --progress=plain -f Dockerfile -t [SPACE REPOSITORY]/nginx-issue-example:latest --push .
- deploy
gRPCversion:helm install nginx-issue-example-grpc k8s/simple-app-customized -f k8s/grpc_values.yaml
- deploy
WebSocketsversion:helm install nginx-issue-example-websockets k8s/simple-app-customized -f k8s/websockets_values.yaml