public static void main(String[] args) throws IOException, InterruptedException {
        /* The port on which the server should run */
        int port;
        try {
            port = Integer.parseInt(System.getenv("GRPC_SERVER_PORT"));
        } catch (NumberFormatException e) {
            // use default port
            port = 50051;
        }

        final boolean useBlockingTaskExecutor =
                Boolean.parseBoolean(System.getenv("GRPC_SERVER_USE_BLOCKING_EXECUTOR"));

        final Server server =
                Server.builder()
                      .http(port)
                      .service(GrpcService.builder()
                                          .addService(new GreeterImpl())
                                          .supportedSerializationFormats(GrpcSerializationFormats.PROTO)
                                          .useBlockingTaskExecutor(useBlockingTaskExecutor)
                                          .build())
                      .disableDateHeader()
                      .disableServerHeader()
                      .build();
        server.start().join();
        final Version armeria = Version.get("armeria");
        System.err.println(armeria + " Server started, listening on " + port);
        server.closeOnJvmShutdown(() -> {
            // Use stderr here since the logger may have been
            // reset by its JVM shutdown hook.
            System.err.println("*** shutting down gRPC server since JVM is shutting down");
            try {
                server.stop().get(30, TimeUnit.SECONDS);
            } catch (InterruptedException | ExecutionException | TimeoutException e) {
                e.printStackTrace();
            }
            System.err.println("*** server shut down");
        });
    }
A gRPC server which is used for measuring performance with https://github.com/bojand/ghz.
Use {@code bench.sh} to load this server.
benchmarks/ghz/src/main/java/com/linecorp/armeria/grpc/ghz/GreeterServer.java