{"id":19492784,"url":"https://github.com/oatpp/benchmark-websocket","last_synced_at":"2025-06-12T16:40:53.581Z","repository":{"id":94411234,"uuid":"177479234","full_name":"oatpp/benchmark-websocket","owner":"oatpp","description":"Websocket Client and Server for benchmarks with Millions of concurrent connections.","archived":false,"fork":false,"pushed_at":"2024-05-19T23:22:27.000Z","size":81,"stargazers_count":96,"open_issues_count":2,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T22:53:04.723Z","etag":null,"topics":["benchmark","millions-of-connections","oatpp","websocket"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C++","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/oatpp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-24T22:53:44.000Z","updated_at":"2024-09-05T14:13:54.000Z","dependencies_parsed_at":"2024-11-07T00:28:29.798Z","dependency_job_id":"24382fba-4519-449c-84a1-dfa41ce53aa5","html_url":"https://github.com/oatpp/benchmark-websocket","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"d30f971d6e943ea157e20da89dcfe153a026fec2"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fbenchmark-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fbenchmark-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fbenchmark-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Fbenchmark-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/benchmark-websocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224742660,"owners_count":17362232,"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":["benchmark","millions-of-connections","oatpp","websocket"],"created_at":"2024-11-10T21:23:00.192Z","updated_at":"2024-11-17T22:02:37.524Z","avatar_url":"https://github.com/oatpp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# benchmark-websocket [![Build Status](https://dev.azure.com/lganzzzo/lganzzzo/_apis/build/status/oatpp.benchmark-websocket?branchName=master)](https://dev.azure.com/lganzzzo/lganzzzo/_build/latest?definitionId=19\u0026branchName=master)\n\nAbout recent results read here: [5 Million WebSockets](https://oatpp.io/benchmark/websocket/5-million/)\n\nSee also:\n\n- [Oat++ Website](https://oatpp.io/)\n- [Oat++ Github Repository](https://github.com/oatpp/oatpp)\n- [oatpp-websocket Repository](https://github.com/oatpp/oatpp-websocket)\n\n## Overview\n\nThis repo contains both server and client used in oatpp-websocket-benchmarks. \nBoth server and client are implemented based on oatpp Async API and [oatpp-coroutines](https://oatpp.io/docs/oatpp-coroutines/)\n\n### Repo structure\n\n```\n|- client/\n|    |- src/                    // client source code\n|    |- CMakeLists.txt          // client CMakeLists.txt\n|\n|- server/\n|    |- src/                    // server source code\n|    |- CMakeLists.txt          // server CMakeLists.txt\n|\n|- prepare.sh                   // prepare script - will clone oatpp and oatpp-websocket. build and install.\n|- sock-config.sh               // configure required sysctl(s)\n```\n\n## Reproduce latest benchmark\n\nCreate two `n1-highmem-16 (16 vCPUs, 104 GB memory) - Debian GNU/Linux 9` instances in same VPC on Google Cloud.\n\n### Execute the following commands for both instances (SSH).\n\n- Install git\n\n```bash\n$ sudo su\n$ apt-get update\n...\n$ apt-get install -y git\n...\n```\n\n- Clone [benchmark-websocket repo](https://github.com/oatpp/benchmark-websocket) and `cd` to repo folder \n\n```bash\n$ git clone https://github.com/oatpp/benchmark-websocket\n...\n$ cd benchmark-websocket\n```\n\n- Install `oatpp` and `oatpp-websocket` modules (run ./prepare.sh script).\n\n```bash\n$ ./prepare.sh\n```\n\n- Configure environment (run ./sock-config-5m.sh script)\n\n```bash\n$ ./sock-config-5m.sh\n$ ulimit -n 6000000\n```\n\n### Build and Run Server\n\nCommands for server instance only:\n\n- Build server\n\n```bash\n$ cd server/build/\n$ cmake ..\n$ make\n```\n\n- Run server\n\n```bash\n$ ./wsb-server-exe --tp 16 --tio 8 --pc 500\n```\nwhere:  \n`--tp` - number of data-processing threads.  \n`--tio` - number of I/O workers.  \n`--pc` - number of ports to listen to.\n\n### Build and Run Client\n\nCommands for client instance only:\n\n- Build client\n\n```bash\n$ cd client/build/\n$ cmake ..\n$ make\n```\n\n- Run client\n\n```bash\n$ ./wsb-client-exe --tp 16 --tio 8 -h \u003cserver-private-ip\u003e --socks-max 5000000 --socks-port 10000 --si 1000 --sf 30 --pc 500\n```\nwhere:  \n`--tp` - number of data-processing threads.  \n`--tio` - number of I/O workers.  \n`-h \u003cserver-private-ip\u003e` - substitute **private-ip** of server instance here.  \n`--socks-max` - how many client connections to establish.  \n`--socks-port` - how many client connections per port.  \n`--si 1000 --sf 30` - control how fast clients will connect to server. Here - each `1000` iterations sleep for `30` milliseconds.  \n`--pc` - number of available server ports to connect to. \n\n**Note** - clients will not start load until all clients are connected.  \n**Note** - client app will fail with assertion if any of clients has failed.\n\n## Links\n\n- [Latest Benchmark](https://oatpp.io/benchmark/websocket/5-million/)\n- [Oat++ Github Repository](https://github.com/oatpp/oatpp)\n- [oatpp-websocket Repository](https://github.com/oatpp/oatpp-websocket)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Fbenchmark-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Fbenchmark-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Fbenchmark-websocket/lists"}