Configs2026年5月28日·1 分钟阅读

Kitex — High-Performance Go RPC Framework by CloudWeGo

Kitex is a high-performance, extensible Go RPC framework built by ByteDance. It supports Thrift, Protobuf, and gRPC protocols with built-in service governance features like circuit breaking, retry, and load balancing.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Kitex RPC Framework
直接安装命令
npx -y tokrepo@latest install 5fe2382f-5ad3-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Kitex is a Go RPC framework created by ByteDance as part of the CloudWeGo open-source initiative. It is designed for microservice architectures that demand low latency, high throughput, and extensible middleware, providing built-in support for Thrift, Protobuf, and gRPC transports.

What Kitex Does

  • Generates Go server and client code from Thrift or Protobuf IDL files
  • Provides high-performance network transport with connection pooling and multiplexing
  • Includes built-in service governance: circuit breaker, retry, timeout, and load balancing
  • Supports middleware chains for logging, tracing, and metrics collection
  • Integrates with service registries like etcd, Nacos, ZooKeeper, and Consul

Architecture Overview

Kitex uses a layered design: the code generator (kitex tool) produces typed stubs from IDL, the transport layer handles connection management and protocol encoding, and the middleware layer chains interceptors for cross-cutting concerns. The default transport uses Netpoll, a high-performance non-blocking I/O library optimized for Go, which avoids the overhead of goroutine-per-connection models under heavy load.

Self-Hosting & Configuration

  • Install the code generator with go install github.com/cloudwego/kitex/tool/cmd/kitex@latest
  • Define services in Thrift or Protobuf IDL files
  • Run kitex -module <mod> -service <svc> <idl> to generate server scaffolding
  • Configure timeouts, retries, and circuit breakers via client options in code
  • Register with etcd or Nacos for service discovery in production

Key Features

  • Netpoll-based transport delivering low-latency RPC under high concurrency
  • Multi-protocol support: Thrift, Protobuf, and gRPC interoperability
  • Pluggable middleware for observability, auth, and rate limiting
  • Connection multiplexing reduces resource usage for large service graphs
  • Generic call support for dynamic invocation without compiled stubs

Comparison with Similar Tools

  • gRPC-Go — widely adopted but limited to Protobuf; Kitex also supports Thrift natively
  • Dubbo-Go — Java-ecosystem heritage; Kitex is Go-native with Netpoll optimization
  • Kratos — Bilibili's Go framework with HTTP focus; Kitex targets pure RPC workloads
  • go-micro — higher-level abstraction; Kitex offers more control over transport and encoding
  • Twirp — simple Protobuf-over-HTTP; Kitex supports persistent connections and multiplexing

FAQ

Q: Can Kitex interoperate with gRPC services? A: Yes, Kitex supports the gRPC protocol, so Kitex clients can call standard gRPC servers and vice versa.

Q: What serialization formats does Kitex support? A: Thrift (binary, compact), Protobuf, and Flatbuffers via the code generator.

Q: How does Kitex handle service discovery? A: Kitex provides resolver interfaces with official extensions for etcd, Nacos, ZooKeeper, Consul, and Polaris.

Q: Is Kitex production-ready? A: Kitex runs thousands of microservices at ByteDance, handling tens of millions of requests per second.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产