Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liorf committed Aug 5, 2024
1 parent be64ec1 commit 9c8d5c0
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 17 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ baseurl: "" # the subpath of your site, e.g. /blog
url: "https://liorfranko.github.io" # the base hostname & protocol for your site, e.g. http://example.com
github_username: liorfranko
linkedin_username: liorfranko

# Build settings
theme: minima
plugins:
Expand Down
Binary file added images/latencies-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/per-pod-cpu-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/per-pod-p50-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/per-pod-p90-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/per-pod-p95-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/per-pod-p99-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/per-pod-rps-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/total-cpu-usage-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 28 additions & 17 deletions index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ server {
We used [Fortio](https://github.com/fortio/fortio) to generate load at a rate of 1,500 requests per second (rps).

### Pod List and Calculated Fibonacci Numbers:
Pods with Fibonacci 25
Pods with calculated fibonacci number for 25
- sleep-lior-2-6794d4cfdc-2gs9b
- sleep-lior-2-6794d4cfdc-6r6lg
- sleep-lior-2-6794d4cfdc-rvmd2

Pods with Fibonacci 26
Pods with calculated fibonacci number for 26
- sleep-lior-2-6794d4cfdc-jgxqg
- sleep-lior-2-6794d4cfdc-stjzd

Pods with Fibonacci 27
Pods with calculated fibonacci number for 27
- sleep-lior-2-6794d4cfdc-7rrwr
- sleep-lior-2-6794d4cfdc-gv856
- sleep-lior-2-6794d4cfdc-jz462
Expand All @@ -114,64 +114,75 @@ Pods with Fibonacci 27
- sleep-lior-2-6794d4cfdc-qnlnl
- sleep-lior-2-6794d4cfdc-tffd9

Pods with Fibonacci 29
Pods with calculated fibonacci number for 29
- sleep-lior-2-6794d4cfdc-mp8sn: 29

### Results Before Optimization

Performance Metrics:
- Total CPU Usage: 10 CPUs

Expression: `sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{container!="POD",container=~"sleep-lior-2"})`

![alt text](images/total-cpu-usage-before.png)
- CPU Usage Range: 2 (highest pod) to 0.2 (lowest pod)

Expression: `sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{container!="POD", container="sleep-lior-2"}) by (pod)`

![alt text](images/per-pod-cpu-before.png)

Latency Metrics:
![alt text](images/latencies-before.png)
Expression: `histogram_quantile(<0.5/0.9/0.95/0.99>, sum(rate(istio_request_duration_milliseconds_bucket{reporter="destination",destination_canonical_service="sleep-lior-2",request_protocol="http",response_code=~"2.*",pod=~"sleep-lior-2.*"}[2m])) by (le,pod))`
- p50 Latency: 14ms (ranging from 50ms to 6ms)
![alt text](images/per-pod-p50-before.png)
- p90 Latency: 38ms (ranging from 100ms to 10ms)
![alt text](images/per-pod-p90-before.png)
- p95 Latency: 47ms (ranging from 170ms to 17ms)
![alt text](images/per-pod-p95-before.png)
- p99 Latency: 93ms (ranging from 234ms to 23ms)
![alt text](images/per-pod-p99-before.png)
- Request Rate per Pod: 100 requests per second (rp/s)
![alt text](images/per-pod-rps-before.png)

### Results After Optimization

Performance Metrics:
- Total CPU Usage: 8 CPUs
- Total CPU Usage: Decreased from 10 CPUs to 8 CPUs
![alt text](images/CPU-Usage-Reduction.png)
- CPU Usage Range: 0.6 (highest pod) to 0.45 (lowest pod)
![alt text](images/per-pod-cpu.png)

Latency Metrics:
![alt text](images/Latency-Reductions.png)
- p50 Latency: 13.2ms (ranging from 23ms to 9ms)
![alt text](images/per-pod-p50.png)
- p90 Latency: 24ms (ranging from 46ms to 21ms)
![alt text](images/per-pod-p90.png)
- p95 Latency: 33ms (ranging from 50ms to 23ms)
![alt text](images/per-pod-p95.png)
- p99 Latency: 47ms (ranging from 92ms to 24ms)
![alt text](images/per-pod-p99.png)
- Request Rate per Pod: Adjusted, with the fastest pod handling 224 rp/s and the slowest pod handling 25 rp/s
![alt text](images/per-pod-rps.png)

### Interpretation of Results

The optimization demonstrated significant performance improvements:

CPU Usage Reduction:
![High-Level Design](images/CPU-Usage-Reduction.png)
- The total CPU usage of all the pods decreased from 10 CPUs to 8 CPUs, indicating more efficient resource utilization.

Latency Reductions:
![alt text](images/Latency-Reductions.png)
- p50 Latency: Decreased from 14ms to 13.2ms

![alt text](images/per-pod-p50.png)
- p90 Latency: Improved drastically from 38ms to 24ms

![alt text](images/per-pod-p90.png)
- p95 Latency: Went down from 47ms to 33ms

![alt text](images/per-pod-p95.png)
- p99 Latency: Nearly halved from 93ms to 47ms

![alt text](images/per-pod-p99.png)

Balanced Load Distribution:
- Post-optimization, request rates adjusted dynamically to ensure that faster pods handle more requests (up to 224 rp/s), and slower pods handle fewer requests (down to 25 rp/s), contributing to lower latencies and balanced resource usage.

![alt text](images/per-pod-cpu.png)

![alt text](images/per-pod-rps.png)

## Conclusion

Expand Down

0 comments on commit 9c8d5c0

Please sign in to comment.