...
1# ttrpc
2
3[](https://github.com/containerd/ttrpc/actions?query=workflow%3ACI)
4
5GRPC for low-memory environments.
6
7The existing grpc-go project requires a lot of memory overhead for importing
8packages and at runtime. While this is great for many services with low density
9requirements, this can be a problem when running a large number of services on
10a single machine or on a machine with a small amount of memory.
11
12Using the same GRPC definitions, this project reduces the binary size and
13protocol overhead required. We do this by eliding the `net/http`, `net/http2`
14and `grpc` package used by grpc replacing it with a lightweight framing
15protocol. The result are smaller binaries that use less resident memory with
16the same ease of use as GRPC.
17
18Please note that while this project supports generating either end of the
19protocol, the generated service definitions will be incompatible with regular
20GRPC services, as they do not speak the same protocol.
21
22# Protocol
23
24See the [protocol specification](./PROTOCOL.md).
25
26# Usage
27
28Create a gogo vanity binary (see
29[`cmd/protoc-gen-gogottrpc/main.go`](cmd/protoc-gen-gogottrpc/main.go) for an
30example with the ttrpc plugin enabled.
31
32It's recommended to use [`protobuild`](https://github.com/containerd/protobuild)
33to build the protobufs for this project, but this will work with protoc
34directly, if required.
35
36# Differences from GRPC
37
38- The protocol stack has been replaced with a lighter protocol that doesn't
39 require http, http2 and tls.
40- The client and server interface are identical whereas in GRPC there is a
41 client and server interface that are different.
42- The Go stdlib context package is used instead.
43
44# Status
45
46TODO:
47
48- [ ] Add testing under concurrent load to ensure
49- [ ] Verify connection error handling
50
51# Project details
52
53ttrpc is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).
54As a containerd sub-project, you will find the:
55 * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md),
56 * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS),
57 * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md)
58
59information in our [`containerd/project`](https://github.com/containerd/project) repository.
View as plain text