Giter VIP home page Giter VIP logo

benchmark-websocket's Introduction

benchmark-websocket

About recent results read here: 5 Million WebSockets

See also:

Overview

This repo contains both server and client used in oatpp-websocket-benchmarks. Both server and client are implemented based on oatpp Async API and oatpp-coroutines

Repo structure

|- client/main/
|           |- src/              // client source code
|           |- CMakeLists.txt    // client CMakeLists.txt
|
|- server/main/
|           |- src/              // server source code
|           |- CMakeLists.txt    // server CMakeLists.txt
|
|- prepare.sh                    // prepare script - will clone oatpp and oatpp-websocket. build and install.
|- sock-config.sh                // configure required sysctl(s)

Reproduce latest benchmark

Create two n1-highmem-16 (16 vCPUs, 104 GB memory) - Debian GNU/Linux 9 instances in same VPC on Google Cloud.

Execute the following commands for both instances (SSH).

  • Install git
$ sudo su
$ apt-get update
...
$ apt-get install -y git
...
$ git clone https://github.com/oatpp/benchmark-websocket
...
$ cd benchmark-websocket
  • Install oatpp and oatpp-websocket modules (run ./prepare.sh script).
$ ./prepare.sh
  • Configure environment (run ./sock-config-5m.sh script)
$ ./sock-config-5m.sh
$ ulimit -n 6000000

Build and Run Server

Commands for server instance only:

  • Build server
$ cd server/main/build/
$ cmake ..
$ make
  • Run server
$ ./my-project-exe --tp 16 --tio 8 --pc 500

where:
--tp - number of data-processing threads.
--tio - number of I/O workers.
--pc - number of ports to listen to.

Build and Run Client

Commands for client instance only:

  • Build client
$ cd client/main/build/
$ cmake ..
$ make
  • Run client
$ ./my-project-exe --tp 16 --tio 8 -h <server-private-ip> --socks-max 5000000 --socks-port 10000 --si 1000 --sf 30 --pc 500

where:
--tp - number of data-processing threads.
--tio - number of I/O workers.
-h <server-private-ip> - substitute private-ip of server instance here.
--socks-max - how many client connections to establish.
--socks-port - how many client connections per port.
--si 1000 --sf 30 - control how fast clients will connect to server. Here - each 1000 iterations sleep for 30 milliseconds.
--pc - number of available server ports to connect to.

Note - clients will not start load until all clients are connected.
Note - client app will fail with assertion if any of clients has failed.

Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.