import grpc from 'k6/net/grpc';
import { check } from 'k6';
const client = new grpc.Client();
client.load(['proto'], 'hello.proto');
export const options = { vus: 50, duration: '3m' };
export default () => {
client.connect('grpc.example.com:443', { tls: true });
const res = client.invoke('hello.HelloService/SayHello', {
greeting: 'loadtest',
});
check(res, {
'status OK': (r) => r && r.status === grpc.StatusOK,
});
client.close();
};You can either provide .proto files or use server reflection. k6 supports both approaches for service discovery and message serialization.
k6 supports unary RPCs and server-side streaming. Client streaming and bidirectional streaming have limited support — check the k6 gRPC documentation for the latest capabilities.
Load test your REST and GraphQL APIs with up to 200 virtual users for free. Real-time metrics, JavaScript scripting, and instant results.
Run HTTP load tests against any endpoint. Support for GET, POST, PUT, DELETE with custom headers and payloads. Free for up to 200 VUs.
Load test WebSocket servers with hundreds of concurrent connections. Validate message throughput, latency, and connection stability.