Skip to content

Commit

Permalink
Fix Nginx Bottlenecks (#28)
Browse files Browse the repository at this point in the history
* drop access logs

* Update performance results in README.md

* update benchmark.graphql

* Update performance results in README.md

* update benchmark.graphql

* update nginx worker process

* Update performance results in README.md

* chore: update benchmarking group

---------

Co-authored-by: tusharmath <[email protected]>
  • Loading branch information
tusharmath and tusharmath authored Nov 25, 2023
1 parent b2f7267 commit ebe600e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Run benchmark'
name: "Run benchmark"

on:
pull_request:
Expand All @@ -14,7 +14,6 @@ jobs:
runs-on: benchmarking-runner
if: github.event.head_commit.message != 'Update performance results in README.md'
steps:

- name: Checkout (GitHub)
uses: actions/checkout@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ Get started with the benchmarks:

| Server | Requests/sec | Latency (ms) |
|--------:|--------------:|--------------:|
| [Tailcall] | `7,098.02` | `14.05` |
| [Caliban] | `6,428.14` | `15.66` |
| [Gqlgen] | `2,147.01` | `48.48` |
| [Apollo GraphQL] | `1,759.84` | `56.65` |
| [Netflix DGS] | `1,455.06` | `88.90` |
| [Tailcall] | `20,349.70` | `4.90` |
| [Gqlgen] | `15,184.20` | `8.41` |
| [Caliban] | `10,570.30` | `9.51` |
| [Apollo GraphQL] | `3,934.92` | `25.52` |
| [Netflix DGS] | `353.93` | `278.14` |

<!-- PERFORMANCE_RESULTS_END -->

Expand Down
Binary file modified assets/latency_histogram.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 modified assets/req_sec_histogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions graphql/tailcall/benchmark.graphql
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
schema
@server(
port: 8000
enableGraphiql: true
enableQueryValidation: false
workers: 16
) @upstream(
baseURL: "http://jsonplaceholder.typicode.com"
enableHttpCache: false
poolMaxIdlePerHost: 200
tcpKeepAlive: 60
proxy: {url: "http://127.0.0.1:3000"}
){
@server(port: 8000, enableGraphiql: true, enableQueryValidation: false)
@upstream(
baseURL: "http://jsonplaceholder.typicode.com"
poolMaxIdlePerHost: 200
tcpKeepAlive: 60
proxy: { url: "http://127.0.0.1:3000" }
) {
query: Query
}

Expand Down
3 changes: 1 addition & 2 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pid /tmp/nginx.pid;
worker_processes 1;
worker_processes auto;

events {
worker_connections 512;
Expand All @@ -8,7 +8,6 @@ events {
error_log /tmp/error.log error;

http {
access_log /tmp/access.log;
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=http_cache:10m max_size=1g inactive=60m use_temp_path=on;
client_body_temp_path /tmp/nginx-client-body;
proxy_temp_path /tmp/nginx-proxy;
Expand Down
Empty file modified nginx/run.sh
100644 → 100755
Empty file.

0 comments on commit ebe600e

Please sign in to comment.