apache/brpc

GitHub: apache/brpc

bRPC 是一款高性能的工业级 RPC 框架,用于构建高可用性分布式服务。

Stars: 17520 | Forks: 4117

[中文版](README_cn.md) [![Linux 构建状态](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/719cef5fed001833.svg)](https://github.com/apache/brpc/actions/workflows/ci-linux.yml) [![MacOs 构建状态](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/67ce502ce1001837.svg)](https://github.com/apache/brpc/actions/workflows/ci-macos.yml) ![brpc logo (light)](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/2f5a35d17f001840.png) ![brpc logo (dark)](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/99f80b97c4001844.png) [bRPC](https://brpc.apache.org/) 是一个使用 C++ 语言开发的工业级 RPC 框架,常用于高性能系统,如搜索、存储、机器学习、广告、推荐等。 ### "bRPC" 代表 "更好的 RPC"。 您可以使用它来: * 构建一个可以支持多种协议(**在同一端口**)的服务器,或访问各种服务 * restful http/https,[h2](https://httpwg.org/specs/rfc9113.html)/[gRPC](https://grpc.io)。在 bRPC 中使用 http/h2 比使用 [libcurl](https://curl.haxx.se/libcurl/)更友好。使用 HTTP/h2+json 访问基于 protobuf 的协议,可能来自其他语言。 * [redis](docs/en/redis_client.md) 和 [memcached](docs/en/memcache_client.md),线程安全,比官方客户端更友好和高效。 * [rtmp](https://github.com/apache/brpc/blob/master/src/brpc/rtmp.h)/[flv](https://en.wikipedia.org/wiki/Flash_Video)/[hls](https://en.wikipedia.org/wiki/HTTP_Live_Streaming),用于构建 [流媒体服务](https://github.com/brpc/media-server)。 * hadoop_rpc(可能开源) * [rdma](https://en.wikipedia.org/wiki/Remote_direct_memory_access) 支持 * [thrift](docs/en/thrift.md) 支持,线程安全,比官方客户端更友好和高效。 * 百度使用的各种协议:[baidu_std](docs/en/baidu_std.md), [streaming_rpc](docs/en/streaming_rpc.md), hulu_pbrpc, [sofa_pbrpc](https://github.com/baidu/sofa-pbrpc), nova_pbrpc, public_pbrpc, ubrpc 和基于 nshead 的协议。 * 使用工业级实现的 [RAFT 一致性算法](https://raft.github.io) 构建 [高可用性](https://en.wikipedia.org/wiki/High_availability) 分布式服务,该算法已在 [braft](https://github.com/brpc/braft) 上开源。 * 服务器可以同步或异步处理请求。 * 客户端可以同步、异步、半同步访问服务器,或使用 [组合通道](docs/en/combo_channel.md) 来声明式地简化分片或并行访问。 * 通过 http 调试服务,并运行 [cpu](docs/en/cpu_profiler.md), [heap](docs/en/heap_profiler.md) 和 [contention](docs/en/contention_profiler.md) 分析器。 * 获取 [更好的延迟和吞吐量](docs/en/overview.md#better-latency-and-throughput)。 * 快速使用您组织使用的协议 [扩展 bRPC](docs/en/new_protocol.md),或自定义组件,包括 [命名服务](docs/en/load_balancing.md)(dns, zk, etcd)、[负载均衡器](docs/en/load_balancing.md)(rr, random, consistent hashing)。 # 尝试一下! * 阅读 [概述](docs/en/overview.md) 了解 bRPC 的应用场景和优势。 * 阅读 [入门指南](docs/en/getting_started.md) 了解构建步骤,并尝试 [示例](https://github.com/apache/brpc/tree/master/example/)。 * 文档: * [性能基准](docs/en/benchmark.md) * [bvar](docs/en/bvar.md) * [bvar_c++](docs/en/bvar_c++.md) * [bthread](docs/en/bthread.md) * [bthread 或不](docs/en/bthread_or_not.md) * [线程局部](docs/en/thread_local.md) * [执行队列](docs/en/execution_queue.md) * [bthread 跟踪器](docs/en/bthread_tracer.md) * [bthread 标记任务组](docs/en/bthread_tagged_task_group.md) * 客户端 * [基础](docs/en/client.md) * [错误代码](docs/en/error_code.md) * [组合通道](docs/en/combo_channel.md) * [访问 http/h2](docs/en/http_client.md) * [访问 gRPC](docs/en/http_derivatives.md#h2grpc) * [访问 thrift](docs/en/thrift.md#client-accesses-thrift-server) * [访问 UB](docs/en/ub_client.md) * [流式 RPC](docs/en/streaming_rpc.md) * [访问 redis](docs/en/redis_client.md) * [访问 memcached](docs/en/memcache_client.md) * [备份请求](docs/en/backup_request.md) * [虚拟服务器](docs/en/dummy_server.md) * 服务器 * [基础](docs/en/server.md) * [服务 http/h2](docs/en/http_service.md) * [服务 gRPC](docs/en/http_derivatives.md#h2grpc) * [服务 thrift](docs/en/thrift.md#server-processes-thrift-requests) * [服务 Nshead](docs/en/nshead_service.md) * [调试服务器问题](docs/en/server_debugging.md) * [服务器推送](docs/en/server_push.md) * [雪崩](docs/en/avalanche.md) * [自动并发限制器](docs/en/auto_concurrency_limiter.md) * [媒体服务器](https://github.com/brpc/media-server) * [json2pb](docs/en/json2pb.md) * [内置服务](docs/en/builtin_service.md) * [状态](docs/en/status.md) * [变量](docs/en/vars.md) * [连接](docs/en/connections.md) * [标志](docs/en/flags.md) * [rpcz](docs/en/rpcz.md) * [cpu 分析器](docs/en/cpu_profiler.md) * [heap 分析器](docs/en/heap_profiler.md) * [contention 分析器](docs/en/contention_profiler.md) * 工具 * [rpc_press](docs/en/rpc_press.md) * [rpc_replay](docs/en/rpc_replay.md) * [rpc_view](docs/en/rpc_view.md) * [benchmark_http](docs/en/benchmark_http.md) * [parallel_http](docs/en/parallel_http.md) * 其他 * [IOBuf](docs/en/iobuf.md) * [流式日志](docs/en/streaming_log.md) * [FlatMap](docs/en/flatmap.md) * [协程](docs/en/coroutine.md) * [断路器](docs/en/circuit_breaker.md) * [RDMA](docs/en/rdma.md) * [Bazel 支持](docs/en/bazel_support.md) * [Wireshark baidu_std 解析器插件](docs/en/wireshark_baidu_std.md) * [bRPC 介绍](docs/cn/brpc_intro.pptx)(培训材料) * [构建大规模服务的教程](docs/en/tutorial_on_building_services.pptx)(培训材料) * [bRPC 内部](docs/en/brpc_internal.pptx)(培训材料) * RPC 深入 * [新协议](docs/en/new_protocol.md) * [原子指令](docs/en/atomic_instructions.md) * [IO](docs/en/io.md) * [线程概述](docs/en/threading_overview.md) * [负载均衡](docs/en/load_balancing.md) * [局部感知](docs/en/lalb.md) * [一致性哈希](docs/en/consistent_hashing.md) * [内存管理](docs/en/memory_management.md) * [计时器维护](docs/en/timer_keeping.md) * [bthread_id](docs/en/bthread_id.md) * 用例 * [用户案例](community/cases.md) # 贡献代码 请参阅 [此处](CONTRIBUTING.md)。 # 反馈和参与 * 通过 [Github Issues](https://github.com/apache/brpc/issues) 报告错误、提问或提出建议 * 订阅邮件列表(dev-subscribe@brpc.apache.org)以获取项目更新 # 行为准则 我们遵循 Apache 软件基金会的行为准则,请参阅此处 [链接](https://www.apache.org/foundation/policies/conduct)。
标签:Apache软件基金会, Apex, C++, FLV, gRPC, Hadoop, HLS, HTTP/HTTPS, libcurl, Memcached, NOVAPBRPC, NSHEAD, Python工具, RDMA, Redis, RESTful API, RPC框架, RTMP, SOFAPBRPC, Thrift, UBRPC, 存储系统, 广告系统, 性能优化, 推荐系统, 提示词优化, 搜索引擎, 搜索引擎查询, 数据擦除, 机器学习, 检测绕过, 流媒体服务, 百度标准协议, 线程安全, 跨协议通信, 高可用性, 高性能系统