tailcallhq/graphql-benchmarks

Nginx proxy is not working

Closed this issue · 3 comments

Hi, it seems that since #28 the Nginx proxy doesn't work as expected, which means that the graphql endpoints are returning errors. This largely explains why both Taillcall and Gqlgen saw a massive increase in throughput and RPS after the PR was merged in, since their underlying server / client is more performant than Caliban's. Also likely explains why DGS is crashing (probably doesn't handle the client failures well).

Steps to reproduce:

./nginx/run.sh
./graphql/tailcall/run.sh &
sleep 2
./test_query.sh

Running the above returns:

{"data":null,"errors":[{"message":"IOException: Request error: error sending request for url (http://jsonplaceholder.typicode.com/posts): error trying to connect: tcp connect error: Connection refused (os error 111)","locations":[{"line":1,"column":2}]}]}

The PR only disabled the access logs on nginx, which just increased it's throughput. This increase improved the performance of all the servers including caliban.

The connection errors happen because caliban doesn't close the connections immediately after the test is over, which results in residual port usage sometimes. I think if you add a finalizer using ZIO where the client is also closed, it would fix the issue.

@tusharmath The reproducer I provided was with using tailcall, althought it's the same across all server implementations

Just to clarify: This is not an issue with the server(s). The call to the proxy is falling, which in turn causes the servers to (correctly) return an error instead of the expected response.