dgs-framework icon indicating copy to clipboard operation
dgs-framework copied to clipboard

Performance issues

Open AbbadoLambily opened this issue 2 years ago • 11 comments

same environment same service code

jmeter pressure test DGS: 400/sec graphql-spring-boot-starter: 2200/sec resful api:2200/sec

where is so much performance consumed ?

AbbadoLambily avatar Apr 13 '22 00:04 AbbadoLambily

That's interesting and quite surprising! We've run perf tests in the past which showed it was pretty much equal to just a RestController, and haven't noticed any significant changes. Could you share your test setup so that we can reproduce it?

paulbakker avatar Apr 13 '22 15:04 paulbakker

That's interesting and quite surprising! We've run perf tests in the past which showed it was pretty much equal to just a RestController, and haven't noticed any significant changes. Could you share your test setup so that we can reproduce it?

It’s a simple database query, the only difference being@PostMapping and@DgsQuery

AbbadoLambily avatar Apr 13 '22 22:04 AbbadoLambily

After testing, the returned results have multiple Boolean types or other types, and the performance is much degraded @paulbakker

AbbadoLambily avatar Apr 14 '22 10:04 AbbadoLambily

Do you mean using scalars? Maybe you can share an example of the result which you think is causing the problem?

paulbakker avatar Apr 14 '22 16:04 paulbakker

@AbbadoLambily I would really help if you share with us the project, or at least your GraphQL Schema and GraphQL Queries.

berngp avatar Apr 14 '22 18:04 berngp

Test code has been uploaded to my github Https://github.com/abbadolambily/dgs-demo.git After the service is running, use Test.jmx to perform JMETER pressure test

@berngp @paulbakker 😄

AbbadoLambily avatar Apr 15 '22 00:04 AbbadoLambily

image

AbbadoLambily avatar Apr 15 '22 04:04 AbbadoLambily

@berngp Did you find the reason? 😔

AbbadoLambily avatar Apr 20 '22 11:04 AbbadoLambily

When I run your JMeter GraphQL test plan, I get ~1650 requests / sec with DGS v4.9.25.

I also tried it with the latest release candidate (v4.10.0-rc.4), as we made some potential performance improvements there, and I got ~2150 requests / sec, about a 30% increase.

When I run your JMeter test plan against the REST endpoint, I get 17,000 requests / sec. However, I am not sure it's a fair comparison, as your REST endpoint does not take a request body, whereas the GraphQL endpoint obviously does, and has to parse the query on each request, etc.

Other relevant details about my setup:

JVM: 11.0.13-zulu Heap size: 16gb GC: G1

kilink avatar Apr 26 '22 04:04 kilink

Where can I download the RC version of Maven dependency @kilink

AbbadoLambily avatar Apr 26 '22 08:04 AbbadoLambily

Hi @AbbadoLambily, the changes have been released in v4.10.0

kilink avatar May 03 '22 01:05 kilink