Test your microservices at scale
gRPC Load Testing
This standalone example loads a protocol-buffer file and invokes a unary gRPC method. Measure latency and status results at agreed concurrency; streaming requires a different script.
loadtest.dev runs HTTP plans; this guide uses k6 directly.
Adapt this script and run it with k6 against an approved target. loadtest.dev accepts declarative GET/HEAD plans; it does not execute these scripts.
Unary and streaming RPC support
Protocol buffer message serialization
TLS and mutual TLS authentication
Service reflection for auto-discovery
Per-method latency tracking
Microservice dependency chain testing
grpc-test.js
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 is the default
const res = client.invoke('hello.HelloService/SayHello', {
greeting: 'loadtest',
});
check(res, {
'status OK': (r) => r && r.status === grpc.StatusOK,
});
client.close();
};Frequently asked questions
Related guides
API Load Testing
Learn how to test HTTP APIs with standalone k6 scripts, measure latency and failed requests, and choose rates suited to your approved target.
Use an HTTP plan with loadtest.dev
For estate apps, declare GET/HEAD requests to a verified hostname and submit a plan through the authenticated API.