Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerize the benchmark for resources control (WIP) #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YassinEldeeb
Copy link
Member

@YassinEldeeb YassinEldeeb commented Jan 11, 2024

  • docker compose
  • rust REST server
  • REST source
  • CI

@YassinEldeeb YassinEldeeb changed the title dockerize the benchmark for resources control dockerize the benchmark for resources control (WIP) Jan 11, 2024
Copy link

🚨 Rust Panic Audit: 136 Potential Panic Points Detected 🚨

Crate: vrl

📊 Total Usages: 37

  • 🔎 expect usages: 1
  • 🚨 panic usages: 1
  • 🔢 array_index usages: 3
  • 🎁 unwrap usages: 32

Crate: jwt_auth

📊 Total Usages: 31

  • 🎁 unwrap usages: 29
  • 🔢 array_index usages: 2

Crate: config

📊 Total Usages: 14

  • 🎁 unwrap usages: 8
  • 🔎 expect usages: 3
  • 🚨 panic usages: 3

Crate: common

📊 Total Usages: 12

  • 🎁 unwrap usages: 12

Crate: engine

📊 Total Usages: 11

  • 🚨 panic usages: 1
  • 🎁 unwrap usages: 9
  • 🔢 array_index usages: 1

Crate: cors

📊 Total Usages: 11

  • 🎁 unwrap usages: 11

Crate: cloudflare_worker

📊 Total Usages: 8

  • 🎁 unwrap usages: 8

Crate: trusted_documents

📊 Total Usages: 4

  • 🔎 expect usages: 4

Crate: graphiql

📊 Total Usages: 3

  • 🎁 unwrap usages: 3

Crate: conductor

📊 Total Usages: 3

  • 🔎 expect usages: 2
  • 🚨 panic usages: 1

Crate: http_get

📊 Total Usages: 1

  • 🎁 unwrap usages: 1

Crate: disable_introspection

📊 Total Usages: 1

  • 🚨 panic usages: 1

📌 Expected Annotations

Crate: napi

📊 Total Expected Usages: 1

  • Reason: "we need this"
  • Code: panic!("Exited process!")
  • Location: ./libs/napi/src/lib.rs:18

Copy link

✅ Benchmark Results

     data_received..................: 210 MB  2.6 MB/s
     data_sent......................: 145 MB  1.8 MB/s
     http_req_blocked...............: min=671ns    avg=3.51µs  med=1.87µs  max=24.01ms  p(95)=2.55µs  p(99)=5.95µs  
     http_req_connecting............: min=0s       avg=63ns    med=0s      max=5.76ms   p(95)=0s      p(99)=0s      
   ✓ http_req_duration..............: min=403.16µs avg=17.34ms med=16.38ms max=120.93ms p(95)=32.7ms  p(99)=44.15ms 
       { expected_response:true }...: min=403.16µs avg=17.34ms med=16.38ms max=120.93ms p(95)=32.7ms  p(99)=44.15ms 
   ✓ http_req_failed................: 0.00%   ✓ 0           ✗ 400300
     http_req_receiving.............: min=9.86µs   avg=42.02µs med=23.37µs max=66.25ms  p(95)=42.96µs p(99)=182.97µs
     http_req_sending...............: min=4.56µs   avg=20.83µs med=11µs    max=57.38ms  p(95)=22.31µs p(99)=68.56µs 
     http_req_tls_handshaking.......: min=0s       avg=0s      med=0s      max=0s       p(95)=0s      p(99)=0s      
     http_req_waiting...............: min=368.77µs avg=17.28ms med=16.33ms max=84.04ms  p(95)=32.62ms p(99)=43.9ms  
     http_reqs......................: 400300  5003.711994/s
     iteration_duration.............: min=465.57µs avg=17.48ms med=16.5ms  max=121.33ms p(95)=32.85ms p(99)=44.44ms 
     iterations.....................: 400300  5003.711994/s
   ✓ valid_graphql_response.........: 100.00% ✓ 400300      ✗ 0     
   ✓ valid_http_code................: 100.00% ✓ 400300      ✗ 0     
     vus............................: 1       min=1         max=100 
     vus_max........................: 100     min=100       max=100 

@dotansimha
Copy link
Member

@YassinEldeeb close or leave this one open?
I think since then we made some fixed and adjustments to the benchmark, so it might be fine to run it on the GH runner.

@YassinEldeeb
Copy link
Member Author

YassinEldeeb commented Feb 15, 2024

@dotansimha I think still controlling the resources used by each binary is useful.
the purpose of this is to predictably control the allocated resources for each of the following:

  • upstream source rust server
  • conductor gateway

And currently, we just freely make them allocate whatever they need, when it can be sometimes unfair, the OS doesn't know the purpose of these two, they are simply to the OS perspective just binaries with allocated ports.
Also, it mimics how it would run for most large production infras, where they allocate specified memory and cpu resources for their K8s' pods or docker network as I'm doing in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants