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

perf(balancer) use luajit string.buffer to serialize health checker data #8950

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

bungle
Copy link
Member

@bungle bungle commented Jun 14, 2022

Summary

Use luajit string.buffer to serialize health checker data.

@bungle bungle requested a review from a team as a code owner June 14, 2022 15:35
@bungle bungle force-pushed the perf/balancer-serializer branch from 054d633 to 61f49de Compare June 14, 2022 15:36
@chronolaw
Copy link
Contributor

Hi bungle, this kong/resty/healthcheck.lua is a temporary solution for events library's test. It will be removed when the original health check library migrate to new events library.

So I think we should not spend time on it, or you can create PR for health check library but not here.

@bungle bungle closed this Jun 16, 2022
@bungle bungle deleted the perf/balancer-serializer branch June 16, 2022 08:14
@chronolaw
Copy link
Contributor

I add this feature in health check library, Kong/lua-resty-healthcheck#109

@chronolaw chronolaw restored the perf/balancer-serializer branch June 22, 2022 06:25
@chronolaw
Copy link
Contributor

I think we can still merge this feature and test it even before the health library implements this.

And it is a small change, if this file is finally removed we will have no losses.

@chronolaw chronolaw reopened this Jun 22, 2022
@github-actions
Copy link
Contributor

🚀 Performance test result

Test Suite: 01-rps 02-flamegraph (baseline,single_route,simple)

["Imgur Images","Imgur Images","Imgur Images"]

Click to expand
Please see Github Actions artifacts for flamegraphs.

  ### Result for upstream directly (run 1):
Running 30s test @ http://10.67.35.131:8088/test
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   557.88us    1.24ms  20.07ms   87.32%
    Req/Sec   168.95k    15.86k  226.20k    63.22%
  25232806 requests in 30.10s, 3.29GB read
Requests/sec: 838297.14
Transfer/sec:    111.92MB
### Result for upstream directly (run 2):
Running 30s test @ http://10.67.35.131:8088/test
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   572.37us    1.26ms  12.13ms   87.29%
    Req/Sec   153.00k     8.19k  221.68k    75.15%
  22850264 requests in 30.10s, 2.98GB read
Requests/sec: 759145.92
Transfer/sec:    101.36MB
### Result for upstream directly (run 3):
Running 30s test @ http://10.67.35.131:8088/test
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   577.95us    1.27ms  20.04ms   87.31%
    Req/Sec   152.40k     7.89k  211.12k    77.08%
  22762392 requests in 30.10s, 2.97GB read
Requests/sec: 756243.34
Transfer/sec:    100.97MB
### Combined result for upstream directly:
RPS     Avg: 784562.13
Latency Avg: nanms    Max: nanms
  
### Test Suite: git:863b43cd802e4b4e3314c6325439548aa5b62c15 #simple #no_plugins #single_route
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 1):
Running 30s test @ http://10.67.35.129:8000/s1-r1
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.17ms    1.83ms  36.75ms   88.74%
    Req/Sec    31.90k     8.59k   52.47k    59.65%
  4767807 requests in 30.10s, 1.00GB read
Requests/sec: 158400.78
Transfer/sec:     33.99MB
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 2):
Running 30s test @ http://10.67.35.129:8000/s1-r1
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.17ms    1.83ms  39.14ms   88.85%
    Req/Sec    31.36k     8.71k   54.07k    60.99%
  4686670 requests in 30.10s, 0.98GB read
Requests/sec: 155707.65
Transfer/sec:     33.41MB
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 3):
Running 30s test @ http://10.67.35.129:8000/s1-r1
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.25ms    2.08ms  40.10ms   89.19%
    Req/Sec    31.59k     9.46k   54.22k    58.19%
  4721851 requests in 30.10s, 0.99GB read
Requests/sec: 156874.42
Transfer/sec:     33.66MB
### Combined result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15:
RPS     Avg: 156994.28
Latency Avg: 1.20ms    Max: 40.10ms
  
### Test Suite: git:863b43cd802e4b4e3314c6325439548aa5b62c15 #simple #no_plugins 10 services each has 10 routes
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 1):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.18ms    1.82ms  33.05ms   88.93%
    Req/Sec    30.28k     8.27k   64.21k    58.80%
  4534336 requests in 30.10s, 0.95GB read
Requests/sec: 150643.05
Transfer/sec:     32.32MB
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 2):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.20ms    1.88ms  37.22ms   89.10%
    Req/Sec    30.27k     8.38k   54.14k    58.54%
  4533004 requests in 30.10s, 0.95GB read
Requests/sec: 150600.22
Transfer/sec:     32.31MB
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 3):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.22ms    1.89ms  31.16ms   89.22%
    Req/Sec    29.97k     8.31k   54.70k    60.53%
  4486812 requests in 30.10s, 0.94GB read
Requests/sec: 149064.96
Transfer/sec:     31.99MB
### Combined result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15:
RPS     Avg: 150102.74
Latency Avg: 1.20ms    Max: 37.22ms
  
### Test Suite: git:863b43cd802e4b4e3314c6325439548aa5b62c15 #simple #key-auth 10 services each has 10 routes with key-auth, 100 consumers
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 1):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.22ms    2.05ms 128.66ms   91.38%
    Req/Sec    26.07k     6.48k   40.21k    59.00%
  3903521 requests in 30.10s, 837.59MB read
Requests/sec: 129685.88
Transfer/sec:     27.83MB
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 2):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.23ms    1.87ms  42.42ms   91.05%
    Req/Sec    25.67k     6.83k   44.99k    62.25%
  3836653 requests in 30.10s, 823.24MB read
Requests/sec: 127465.55
Transfer/sec:     27.35MB
### Result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15 (run 3):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.26ms    1.94ms  39.48ms   90.93%
    Req/Sec    25.72k     6.92k   42.27k    61.13%
  3850703 requests in 30.10s, 826.26MB read
Requests/sec: 127931.54
Transfer/sec:     27.45MB
### Combined result for Kong git:863b43cd802e4b4e3314c6325439548aa5b62c15:
RPS     Avg: 128360.99
Latency Avg: 1.24ms    Max: 128.66ms
  
### Test Suite: git:master #simple #no_plugins #single_route
### Result for Kong git:master (run 1):
Running 30s test @ http://10.67.35.129:8000/s1-r1
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.18ms    1.83ms  35.92ms   88.78%
    Req/Sec    31.60k     8.57k   54.68k    61.52%
  4721956 requests in 30.10s, 0.99GB read
Requests/sec: 156878.86
Transfer/sec:     33.66MB
### Result for Kong git:master (run 2):
Running 30s test @ http://10.67.35.129:8000/s1-r1
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.18ms    1.84ms  32.02ms   88.70%
    Req/Sec    31.68k     8.70k   58.92k    63.25%
  4733901 requests in 30.10s, 0.99GB read
Requests/sec: 157274.40
Transfer/sec:     33.75MB
### Result for Kong git:master (run 3):
Running 30s test @ http://10.67.35.129:8000/s1-r1
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.20ms    1.86ms  26.84ms   88.63%
    Req/Sec    31.70k     9.06k   54.20k    59.12%
  4737228 requests in 30.10s, 0.99GB read
Requests/sec: 157382.90
Transfer/sec:     33.77MB
### Combined result for Kong git:master:
RPS     Avg: 157178.72
Latency Avg: 1.19ms    Max: 35.92ms
  
### Test Suite: git:master #simple #no_plugins 10 services each has 10 routes
### Result for Kong git:master (run 1):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.19ms    1.83ms  30.91ms   89.01%
    Req/Sec    29.91k     8.31k   49.30k    59.00%
  4479380 requests in 30.10s, 0.94GB read
Requests/sec: 148817.83
Transfer/sec:     31.93MB
### Result for Kong git:master (run 2):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.20ms    1.86ms  30.68ms   89.21%
    Req/Sec    29.73k     8.19k   53.25k    60.00%
  4450941 requests in 30.10s, 0.93GB read
Requests/sec: 147873.57
Transfer/sec:     31.73MB
### Result for Kong git:master (run 3):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.19ms    1.83ms  36.89ms   89.29%
    Req/Sec    29.67k     8.28k   55.95k    58.80%
  4442305 requests in 30.10s, 0.93GB read
Requests/sec: 147586.35
Transfer/sec:     31.67MB
### Combined result for Kong git:master:
RPS     Avg: 148092.58
Latency Avg: 1.19ms    Max: 36.89ms
  
### Test Suite: git:master #simple #key-auth 10 services each has 10 routes with key-auth, 100 consumers
### Result for Kong git:master (run 1):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.23ms    2.12ms 127.07ms   91.58%
    Req/Sec    26.06k     6.64k   42.90k    60.60%
  3903108 requests in 30.10s, 837.50MB read
Requests/sec: 129672.46
Transfer/sec:     27.82MB
### Result for Kong git:master (run 2):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.22ms    1.79ms  35.42ms   90.87%
    Req/Sec    25.78k     6.69k   44.57k    61.20%
  3860200 requests in 30.10s, 828.29MB read
Requests/sec: 128246.89
Transfer/sec:     27.52MB
### Result for Kong git:master (run 3):
Running 30s test @ http://10.67.35.129:8000/
  5 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.29ms    1.98ms  41.11ms   90.73%
    Req/Sec    25.78k     6.80k   45.56k    60.93%
  3860538 requests in 30.10s, 828.37MB read
Requests/sec: 128258.36
Transfer/sec:     27.52MB
### Combined result for Kong git:master:
RPS     Avg: 128725.90
Latency Avg: 1.25ms    Max: 127.07ms
  

Kong error logs are also available in Github Actions artifacts.

Download Artifacts for detailed results and interactive SVG flamegraphs.

@bungle bungle merged commit a23eb8b into master Jun 22, 2022
@bungle bungle deleted the perf/balancer-serializer branch June 22, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants