Giter Club home page Giter Club logo

dgs-playground's Introduction

dgs-playground

see:

http://localhost:8080/graphiql

findings

  • transaction management: it creates a new transaction for each query instead of joining the current transaction
  • queries are slow (e.g.: p95 386ms at concurrency>10)
  • dataloaders execute code as async futures in common fork join pool. you may want to execute blocking calls to db within a dedicated "IO" thread pool instead see: https://www.graphql-java.com/blog/threads/

runbook

start a local db

$ make db-local.up

example queries + mutations

benchmarking

# verbose
$ ab -v 4 -n 1 -c 1 -T application/json    -p my_data.json  http://localhost:8080/graphql

# quiet
$ ab -n 1 -c 1 -T application/json    -p my_data.json  http://localhost:8080/graphql

file: my_data.json

{"query":"query {\n  \n      shows(titleFilter:\"foo\") {\n        __typename\n        showId\n        title\n        releaseYear\n        reviews {\n            __typename\n            reviewId\n            starScore\n            comment\n            submittedDate\n        }\n    }\n  \n}\n\n\n","variables":null}

some bench results

scenario: load all shows and their reviews

datasource: (reviews: 460 records, shows: 116 records)

api requests: $ ab -n 1000, -c 30

metrics

- gql 2 db queries, 2 db transactions: 1600 ms (p95)
- rest 1 db query, 1 db transaction: 700 ms (p95)
- rest 2 db queries, 1 db transaction: 800 ms
- rest 2 db queries, 2 db transactions: 950 ms

conclusion

the rest api is way faster under load

dgs-playground's People

Contributors

bastman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.