From c32ffad4bab0cddb67ec92d4c1d556b5ed38826b Mon Sep 17 00:00:00 2001 From: xiaosongyang-sv <58348229+xiaosongyang-sv@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:58:55 -0700 Subject: [PATCH] feat: github action for benchmark sanity check (#133) * link config.md to index.md Change-Id: I56bedfa5f781d655214857ea42542251759a28a1 * update (link _config.md to _index.md) Change-Id: I40c329b1e066faebe765675733959239670d9a01 * update readme.md to add config.md link Change-Id: I31e1ac09cb3dab7736ed4e2fb94c83261dfa1132 * merge from main (#131) * fix: Doc refine - link _config.md to _index.md (#129) * link config.md to index.md Change-Id: I56bedfa5f781d655214857ea42542251759a28a1 * update (link _config.md to _index.md) Change-Id: I40c329b1e066faebe765675733959239670d9a01 --------- Co-authored-by: xiaosong yang * fix: update readme.md to add config.md link (#130) * link config.md to index.md Change-Id: I56bedfa5f781d655214857ea42542251759a28a1 * update (link _config.md to _index.md) Change-Id: I40c329b1e066faebe765675733959239670d9a01 * update readme.md to add config.md link Change-Id: I31e1ac09cb3dab7736ed4e2fb94c83261dfa1132 --------- Co-authored-by: xiaosong yang --------- Co-authored-by: xiaosong yang * init github action for benchmark sanity check Change-Id: Ica2cbab2681d196862e307c0b6e15945df2d0b9c * renamed: .github/workflows/sanity-test.yml -> .github/workflows/sanity-test.yaml Change-Id: Id56743fa69e57a03dad2f825e3a2121effd02e4a * Update sanity-test.yaml * rename sanity-test.yaml to build.yaml to test the script Change-Id: I5c5e1659b41a112200e3d60c84670fa71cbac541 * Update build.yaml * Update to test build.yaml * Update and test build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * Update build.yaml * benchmark sanity github action Change-Id: Ie2500a0aff70240b6139905389c3c11aa945b4db * only test http Change-Id: Ia5253a34dc475ffc2fb8bb5245b02c0b48d17145 * debug https Change-Id: I642258ce01f3739b011e6c592f3205f389d1ef33 * benchmark-sanity.yaml applies to master branch. Change-Id: I17f28ef00bbdb1cfa7d55e8b418f401702f0c1cc --------- Co-authored-by: xiaosong yang --- .github/workflows/benchmark-sanity.yaml | 75 +++++++++++++++++++++++ docs/cloudwego/Getting Started/_config.md | 3 +- 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/benchmark-sanity.yaml diff --git a/.github/workflows/benchmark-sanity.yaml b/.github/workflows/benchmark-sanity.yaml new file mode 100644 index 0000000..30d678d --- /dev/null +++ b/.github/workflows/benchmark-sanity.yaml @@ -0,0 +1,75 @@ +name: benchmark sanity check + +on: + push: + branches: + - master + paths-ignore: + - '**.md' + - '**.png' + +env: + RUST_TOOLCHAIN: nightly + TOOLCHAIN_PROFILE: minimal + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - name: Checkout-Sources + uses: actions/checkout@v2 + - name: Install-Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: ${{ env.TOOLCHAIN_PROFILE }} + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + - name: Setup-Certs + run: | + cd examples/ && + ./gen_cert.sh && + cp certs/server.key certs/key.pem && + cp certs/server.crt certs/cert.pem && + cd .. + - name: Install-Run-Server + run: | + # sudo apt-get update && + # sudo apt-get install -y openssl nginx && + sudo cp ./benchmark/server/nginx-web.conf /etc/nginx/nginx.conf && + sudo cp -r ./benchmark/server/webroot/* /usr/share/nginx/html/ && + cat examples/certs/server.key examples/certs/server.crt > ./combined.pem && + sudo mv ./combined.pem /etc/nginx/ && + sudo systemctl enable nginx && + sudo systemctl start nginx && + # curl -vvv http://localhost:10082/ && + sleep 2 + - name: Build-Proxy + run: | + sudo apt-get install -y pkg-config && + cargo build --verbose && + cd .. + - name: Cache + uses: Swatinem/rust-cache@v1 + - name: Checkout-Client + uses: actions/checkout@v2 + with: + repository: 'giltene/wrk2' + path: 'wrk2' + - name: Build-Client + run: | + sudo apt-get -y install gcc make git libssl-dev zlib1g-dev && + cd wrk2 && + make WITH_OPENSSL=/usr && + cd .. && + sleep 2 + - name: Run-Proxy + run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner RUSTUP_TOOLCHAIN=nightly RUST_LOG=NONE /home/runner/.cargo/bin/cargo run --package monolake -- -c benchmark/proxy/monolake/monolake.toml &" + - name: Run-Client-Proxy-Server + working-directory: wrk2 + run: | + sleep 2 + curl -vvv http://localhost:8402/ && + curl -k https://localhost:6443/ && + ./wrk -d 1m -c 640 -t 64 -R 200000 --latency http://localhost:8402 && + ./wrk -d 1m -c 640 -t 64 -R 140000 --latency https://localhost:6443 && + sleep 2 diff --git a/docs/cloudwego/Getting Started/_config.md b/docs/cloudwego/Getting Started/_config.md index e2e9272..2fa69f7 100644 --- a/docs/cloudwego/Getting Started/_config.md +++ b/docs/cloudwego/Getting Started/_config.md @@ -5,7 +5,6 @@ weight: 2 keywords: ["Monolake", "Rust", "Proxy", "Configuration"] description: "This page provides a brief guide for Monolake configuration" --- - ## Configuration This chapter provides a brief guide for Monolake configuration. @@ -14,7 +13,7 @@ The configuration file is in .toml format. Basic configuration includes the foll ### Runtime -This section starts with [runtime]. It defines global run time configurations, including worker threads number and max connection entries. Optionally it may include a field "runtime_type" and it can be assigned to "legacy". Fox example: +This section starts with [runtime]. It defines global run time configurations, including worker threads number and max connection entries. Optionally it may include a field "runtime_type" and it can be assigned to "legacy" (this is default for non-linux OS). If the host OS is linux, it can be also assigned to "iouring" (this is default for linux OS). For example: ```markup [runtime]