{"id":22663662,"url":"https://github.com/kuper-tech/ruby-grpc-research","last_synced_at":"2025-04-12T07:41:31.826Z","repository":{"id":263979047,"uuid":"870534890","full_name":"Kuper-Tech/ruby-grpc-research","owner":"Kuper-Tech","description":"GRPC server implementation research for Ruby","archived":false,"fork":false,"pushed_at":"2024-11-15T09:15:39.000Z","size":2630,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T02:51:14.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kuper-Tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-10T08:09:41.000Z","updated_at":"2024-11-21T13:32:17.000Z","dependencies_parsed_at":"2024-11-21T13:02:38.368Z","dependency_job_id":null,"html_url":"https://github.com/Kuper-Tech/ruby-grpc-research","commit_stats":null,"previous_names":["kuper-tech/ruby-grpc-research"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fruby-grpc-research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fruby-grpc-research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fruby-grpc-research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuper-Tech%2Fruby-grpc-research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kuper-Tech","download_url":"https://codeload.github.com/Kuper-Tech/ruby-grpc-research/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248536995,"owners_count":21120683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-09T12:31:58.490Z","updated_at":"2025-04-12T07:41:31.786Z","avatar_url":"https://github.com/Kuper-Tech.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Research of Ruby GRPC-implementations\n\nWe have been using GRUF framework to run GRPC-server in Ruby. But we faced a lack of query-backlog.\nWhen GRPC-server is overloaded and has no capacity to process request right now, it rejects a request end return ResourseExhausted error.\n\nHere is a research on how to fix it. There are several ways:\n - use revese-proxy with query-backlog to park requests until they could be processed\n - move back query-backlog to ruby-grpc library (by reverting very old [PR](https://github.com/grpc/grpc/pull/8632))\n - migrate to [griffin](https://github.com/cookpad/griffin) framework as alternative with support of backlog and multiprocessing\n\n\n# How it works\n\n![How research works](docs/stand-diagram.png)\n\n# How to run stress-tests\n\n## Provisioning\n\nInstall all the dependencies and run all components:\n - client - Rack-based HTTP-server serving `/hello/gprc`, `/hello/gruf`, `/hello/nginx` and `/hello/griffin` endpoints. Makes GRPC-request to hello-world implementation of GRPC-servers\n - prometheus - a Prometheus instance configured to collect metrics from client\n - grafana - a Grafana UI for visualize metrics, http://localhost:3000\n - gruf - basic implementation based on GRUF framework\n - grpc - grpc-ruby gem based implementation with moved back request backlog patch\n - griffin - GRPC-server based on griffin gem\n - nginx - NGINX GRPC reverse proxy with support of query backlog\n\nTo setup environment run:\n\n```\n# provision\ndip provision\n\n# get services up and running\ndip compose up client grafana prometheus gruf griffin nginx grpc\n```\n\n## Check everything is ok\n\n```\n# check all GRPC-servers are up and running\ndip grpcurl gruf\ndip grpcurl griffin\ndip grpcurl nginx\ndip grpcurl grpc\n\n# check if http server started and is ready to use underlying GRPC\ndip compose exec client curl http://localhost:9292/hello/gruf\ndip compose exec client curl http://localhost:9292/hello/griffin\ndip compose exec client curl http://localhost:9292/hello/grpc\ndip compose exec client curl http://localhost:9292/hello/nginx\n\n# check if metrics port is exposed\ndip compose exec client curl http://localhost:9394/metrics\n```\n\n## Runs stress-tests\n\n```\n# runs k6 stress test for any GRPC-implementation\ndip k6 gruf_http\ndip k6 griffin_http\ndip k6 grpc_http\ndip k6 nginx_http\n```\n\n## Results\n\nNavigate to http://localhost:3000/ admin/password to the \"GRPC endpoint\" dashboard\n![Results](docs/results.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuper-tech%2Fruby-grpc-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuper-tech%2Fruby-grpc-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuper-tech%2Fruby-grpc-research/lists"}