{"id":38054978,"url":"https://github.com/zrlio/darpc","last_synced_at":"2026-01-16T20:23:10.947Z","repository":{"id":57728017,"uuid":"64250365","full_name":"zrlio/darpc","owner":"zrlio","description":"DaRPC: Data Center Remote Procedure Call","archived":false,"fork":false,"pushed_at":"2020-10-13T07:40:18.000Z","size":144,"stargazers_count":54,"open_issues_count":3,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-14T10:08:56.488Z","etag":null,"topics":["high-performance","java","rdma","rpc-framework"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zrlio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-26T19:58:28.000Z","updated_at":"2025-01-05T19:17:09.000Z","dependencies_parsed_at":"2022-08-30T06:11:26.684Z","dependency_job_id":null,"html_url":"https://github.com/zrlio/darpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zrlio/darpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zrlio%2Fdarpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zrlio%2Fdarpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zrlio%2Fdarpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zrlio%2Fdarpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zrlio","download_url":"https://codeload.github.com/zrlio/darpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zrlio%2Fdarpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["high-performance","java","rdma","rpc-framework"],"created_at":"2026-01-16T20:23:10.785Z","updated_at":"2026-01-16T20:23:10.911Z","avatar_url":"https://github.com/zrlio.png","language":"Java","funding_links":[],"categories":["开发框架"],"sub_categories":["RPC框架"],"readme":"\u003c!--\n{% comment %}\n\nCopyright (C) 2016-2018, IBM Corporation\n\nLicensed to the Apache Software Foundation (ASF) under one or more\ncontributor license agreements.  See the NOTICE file distributed with\nthis work for additional information regarding copyright ownership.\nThe ASF licenses this file to You under the Apache License, Version 2.0\n(the \"License\"); you may not use this file except in compliance with\nthe License.  You may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n{% endcomment %}\n--\u003e\n\n# DaRPC: Data Center Remote Procedure Call\n\nDaRPC is a Java library that provides ultra-low latency RPC for RDMA capable network interfaces. \nThe unique features of DaRPC include:\n\n* Ultra-low RPC latencies close to the raw hardware roundtrip latencies. \n  (Depending on the networking hardware and the CPU intensity of the RPC call, RPC latencies of 5-6 microseconds are possible)\n* Efficient asynchronous and non-blocking RPC interfaces\n* Fine grained control over network trade-offs (interrupts, polling, CPU affinities, etc.)\n\n## Building DaRPC\n\nDaRPC is built using [Apache Maven](http://maven.apache.org/) and requires Java version 8 or higher.\nTo build DaRPC and its example programs, execute the following steps:\n\n1. Obtain a copy of DaRPC from [Github](https://github.com/zrlio/darpc)\n2. Make sure your local maven repo contains DiSNI, if not build DiSNI from [Github](https://github.com/zrlio/disni)\n2. Compile and package the source using: mvn -DskipTests install\n\n## How to Run a Simple Example\n\n1. After building DaRPC, make sure DaRPC and its dependencies are in the classpath (e.g., darpc-1.9-jar-with-dependencies.jar). Also add the DaRPC test jar (darpc-1.0-tests.jar) which includes the examples.\n2. Make sure libdisni is part of the LD_LIBRARY_PATH\n3. Make sure the RDMA network interface is configured and up on the test machines (run ibv\\_devices to see the list of RDMA NICs). If your machine does not have RDMA hardware, you can also use SoftiWARP from [Github](https://github.com/zrlio/softiwarp). \n4. Run the server\\: java com.ibm.darpc.examples.server.DaRPCServer -a \\\u003cserver IP\\\u003e\n5. Run the client\\: java com.ibm.darpc.examples.client.DaRPCClient -a \\\u003cserver IP\\\u003e \n\n## Maven Integration\n\nTo use DaRPC in your maven application use the following snippet in your pom.xml file:\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.ibm.darpc\u003c/groupId\u003e\n      \u003cartifactId\u003edarpc\u003c/artifactId\u003e\n      \u003cversion\u003e1.9\u003c/version\u003e\n    \u003c/dependency\u003e\n\n## Basic Steps Required to Implement your own RPC Service\n\nDefine the RPC request and response messages\n\n```\n\tpublic class RdmaRpcRequest implements RdmaRpcMessage {\n\t\tpublic static int SERIALIZED_SIZE = 16;\n\t\t\n\t\tprivate int cmd;\n\t\tprivate int param;\n\t\tprivate long time;\n\t\t\n\t\tpublic RdmaRpcRequest(){\n\t\t}\n\n\t\t@Override\n\t\tpublic void update(ByteBuffer buffer) {\n\t\t\tcmd = buffer.getInt();\n\t\t\tparam = buffer.getInt();\n\t\t\ttime = buffer.getLong();\n\t\t}\n\n\t\t@Override\n\t\tpublic int write(ByteBuffer buffer) {\n\t\t\tbuffer.putInt(cmd);\n\t\t\tbuffer.putInt(param);\n\t\t\tbuffer.putLong(time);\n\t\t\t\n\t\t\treturn SERIALIZED_SIZE;\n\t\t}\n\t}\n```\nDefine the protocol\n```\n\tpublic class RdmaRpcProtocol extends RdmaRpcService\u003cRdmaRpcRequest, RdmaRpcResponse\u003e {\n\t\t@Override\n\t\tpublic RdmaRpcRequest createRequest() {\n\t\t\treturn new RdmaRpcRequest();\n\t\t}\n\n\t\t@Override\n\t\tpublic RdmaRpcResponse createResponse() {\n\t\t\treturn new RdmaRpcResponse();\n\t\t}\n\t}\n```\nDefine the actual RPC service\n```\n\tpublic class RdmaRpcService extends RdmaRpcProtocol {\n\t\tpublic void processServerEvent(RpcServerEvent\u003cRdmaRpcRequest, RdmaRpcResponse\u003e event) throws IOException {\n\t\t\tRdmaRpcProtocol.RdmaRpcRequest request = event.getRequest();\n\t\t\tRdmaRpcProtocol.RdmaRpcResponse response = event.getResponse();\n\t\t\tresponse.setName(request.getParam() + 1);\n\t\t\tevent.triggerResponse();\n\t\t}\n\t}\n```\nStart the server\n```\n\tRdmaRpcService rpcService = new RdmaRpcService();\n\tRpcActiveEndpointGroup\u003cRdmaRpcRequest, RdmaRpcResponse\u003e rpcGroup = RpcActiveEndpointGroup.createDefault(rpcService);\n\tRdmaServerEndpoint\u003cRpcClientEndpoint\u003cRdmaRpcRequest, RdmaRpcResponse\u003e\u003e rpcEndpoint = rpcGroup.createServerEndpoint();\n\trpcEndpoint.bind(addr);\n\twhile(true){\n\t\tserverEp.accept();\n\t}\n```\t\nCall the RPC service from a client\n```\n\tRpcEndpointGroup rpcGroup = RpcPassiveEndpointGroup.createDefault();\n\tRpcEndpoint rpcEndpoint = rpcGroup.createEndpoint();\n\trpcEndpoint.connect(address);\n\tRpcStream\u003cRdmaRpcRequest, RdmaRpcResponse\u003e stream = rpcEndpoint.createStream();\n\tRdmaRpcRequest request = new RdmaRpcRequest();\n\trequest.setParam(77);\n\tRdmaRpcResponse response = new RdmaRpcResponse();\n\tRpcFuture\u003cRdmaRpcRequest, RdmaRpcResponse\u003e future = stream.request(request, response);\n\t...\n\tresponse = future.get();\n\tSystem.out.println(\"RPC completed, return value \" + response.getReturnValue()); //should print 78\n```\n## Choosing the RpcEndpointGroup \n\nRpcEndpointGroups are containers and factories for RPC connections (RpcEndpoint). There are two types of groups available and which type works best depends on the application. The RpcActiveEndpointGroup actively processes network events caused by RDMA messages being transmitted or received. The RpcPassiveEndpointGroup processes network events directly in the process context of the application. As such, the passive mode has typically lower latency but may suffer from contention to per-connection hardware resources in case of large numbers of threads. The active mode, on the other hand, is more robust under large numbers of threads, but has higher latencies. Applications can control the cores and the NUMA affinities that are used for event processing. For server-side RPC processing the active mode is always used. The DaRPC paper discusses the trade-offs between active and passive RPC processing in more detail. \n\n## Contributions\n\nPRs are always welcome. Please fork, and make necessary modifications \nyou propose, and let us know. \n\n## Contact \n\nIf you have questions or suggestions, feel free to post at:\n\nhttps://groups.google.com/forum/#!forum/zrlio-users\n\nor email: zrlio-users@googlegroups.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzrlio%2Fdarpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzrlio%2Fdarpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzrlio%2Fdarpc/lists"}