bojand / ghz

Simple gRPC benchmarking and load testing tool
https://ghz.sh
Apache License 2.0
3.05k stars 271 forks source link

Grpc-web: rpc error: code = Unavailable desc = connection closed before server preface received #428

Open ma54ik opened 11 months ago

ma54ik commented 11 months ago

Hi everyone, I have the following problem:

Proto file(s) syntax = "proto3";

option csharp_namespace = "GrpcWebDemo";

package greet;

// The greeting service definition. service Greeter { // Sends a greeting rpc SayHello (HelloRequest) returns (HelloReply); }

// The request message containing the user's name. message HelloRequest { string name = 1; }

// The response message containing the greetings. message HelloReply { string message = 1; }

Command line arguments / config ./ghz --insecure --proto .../Protos/greet.proto --call greet.Greeter.SayHello -d '{ "name": "Geralt!" }' localhost:9999

Describe the bug Summary: Count: 200 Total: 31.32 ms Slowest: 0 ns Fastest: 0 ns Average: 2.10 ms Requests/sec: 6385.72

Response time histogram:

Latency distribution:

Status code distribution: [Unavailable] 200 responses

Error distribution: [200] rpc error: code = Unavailable desc = connection closed before server preface received

Environment

I created a grpc-web hello world API in dotnet C# and tried the ghz-command mentioned above. Grpcurl works well, but I like to use ghz for benchmark testing. Is ghz working for grpc-web requests? If it works, where is my mistake?

Best regards!

ragmr commented 9 months ago

Hi @ma54ik , any luck with testing grpc-web using ghz? I am in the similar situation where I need to test grpc-web requests and wondering if GHZ supports. Thanks